forked from uc-cdis/commons-frontend-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gwasAppSetup): Initial commit (#5)
* feat(gwasAppSetup): Initial commit * feat(gwasAppSetup): Fixed 508 issues * feat(gwasAppSetup): Got storybook to work and added CI test * feat(gwasAppSetup): Edited CI test to match Spike CI test
- Loading branch information
1 parent
6afdcee
commit 89895f8
Showing
138 changed files
with
26,261 additions
and
4,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,5 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
'@storybook/addon-a11y', | ||
], | ||
framework: { | ||
name: '@storybook/nextjs', | ||
options: {}, | ||
}, | ||
staticDirs: ['../public'], | ||
webpackFinal: async (config) => { | ||
const imageRule = config.module?.rules?.find((rule) => { | ||
const test = (rule as { test: RegExp }).test; | ||
|
||
if (!test) { | ||
return false; | ||
} | ||
|
||
return test.test('.svg'); | ||
}) as { [key: string]: any }; | ||
|
||
imageRule.exclude = /\.svg$/; | ||
|
||
config.module?.rules?.push({ | ||
test: /\.svg$/, | ||
use: ['@svgr/webpack'], | ||
}); | ||
|
||
return config; | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import type { Preview } from '@storybook/react'; | ||
import { MantineProvider } from '@mantine/core'; | ||
import '../src/styles/globals.css'; | ||
import { initialize, mswLoader } from 'msw-storybook-addon'; | ||
|
||
/* | ||
* Initializes MSW | ||
* See https://github.com/mswjs/msw-storybook-addon#configuring-msw | ||
* to learn how to customize it | ||
*/ | ||
initialize(); | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
tags: ['autodocs'], | ||
decorators: [ | ||
(Story) => ( | ||
<MantineProvider> | ||
<Story /> | ||
</MantineProvider> | ||
), | ||
], | ||
loaders: [mswLoader], // 👈 Adds the MSW loader to all stories | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { TestRunnerConfig } from '@storybook/test-runner'; | ||
import { injectAxe, checkA11y } from 'axe-playwright'; | ||
|
||
/* | ||
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api | ||
* to learn more about the test-runner hooks API. | ||
*/ | ||
const config: TestRunnerConfig = { | ||
async preVisit(page) { | ||
await injectAxe(page); | ||
}, | ||
async postVisit(page) { | ||
await checkA11y(page, '#storybook-root', { | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
}); | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.