Skip to content

Commit

Permalink
frontend: storybook update due to webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
ErvinRacz committed Dec 11, 2024
1 parent 98743b3 commit c676731
Show file tree
Hide file tree
Showing 11 changed files with 18,362 additions and 33,206 deletions.
18 changes: 17 additions & 1 deletion frontend/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],

staticDirs: [
"../public/"
],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-create-react-app',
],

framework: {
name: '@storybook/react-webpack5',
options: {}
},

docs: {},

typescript: {
reactDocgen: 'react-docgen-typescript'
}
};
2 changes: 1 addition & 1 deletion frontend/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import theme from './NebraskaTheme';

addons.setConfig({
Expand Down
1 change: 1 addition & 0 deletions frontend/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ export const parameters = {
},
actions: { argTypesRegex: '^on[A-Z].*' },
};
export const tags = ['autodocs'];
12 changes: 12 additions & 0 deletions frontend/.storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { TestRunnerConfig } from '@storybook/test-runner';

const config: TestRunnerConfig = {
async postVisit(page, context) {
// the #storybook-root element wraps the story. In Storybook 6.x, the selector is #root
const elementHandler = await page.$('#storybook-root');
const innerHTML = await elementHandler!.innerHTML();
expect(innerHTML).toMatchSnapshot();
},
};

export default config;
Loading

0 comments on commit c676731

Please sign in to comment.