Skip to content

Commit

Permalink
Try some TS
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanu1 committed Aug 4, 2022
1 parent 212892a commit 174bcba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .storybook/main.js → .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
import type { StorybookConfig } from '@storybook/core-common';

const config: StorybookConfig = {
stories: [
'../tests/**/*.stories.tsx'
],
Expand Down Expand Up @@ -34,4 +36,6 @@ module.exports = {
config.resolve.alias['../utils/location-operations'] = require.resolve('../tests/__fixtures__/utils/location-operations.ts');
return config;
}
};
};

export default config;
3 changes: 2 additions & 1 deletion .storybook/preview.js → .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import './index.css';
import { SearchCoreDecorator } from '../tests/__fixtures__/core/SearchCore';
import { Parameters } from '@storybook/csf';

export const parameters = {
export const parameters: Parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
Expand Down
6 changes: 2 additions & 4 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { injectAxe, checkA11y } from 'axe-playwright';
import { Page } from 'playwright-core';
import { parameters } from './preview';

/*
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental
Expand All @@ -12,10 +13,7 @@ const renderFunctions = {
async postRender(page: Page, context) {
await checkA11y(page, '#root', {
axeOptions: {
runOnly: {
type: 'tag',
values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']
},
runOnly: parameters.a11y.options.runOnly,
rules: {
'color-contrast': { enabled: context.name !== 'Loading' }
},
Expand Down

0 comments on commit 174bcba

Please sign in to comment.