diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..a44eac5b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Test + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + + - name: Install dependencies + run: yarn install + + # Install Playwright browsers so Vitest browser mode can run story tests + - name: Install playwright dependencies + run: yarn exec playwright install chromium --with-deps + + - name: Run tests + run: | + yarn test-storybook \ No newline at end of file diff --git a/.storybook/main.ts b/.storybook/main.ts index 2efc7acb..22348c5b 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -5,8 +5,9 @@ const config: StorybookConfig = { staticDirs: ['../public'], addons: [ '@storybook/addon-essentials', - '@storybook/addon-a11y', '@storybook/experimental-addon-test', + '@chromatic-com/storybook', + '@storybook/addon-a11y', ], framework: { name: '@storybook/react-vite', diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 0416f7a8..3e608ae6 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -21,7 +21,6 @@ initialize({ const preview: Preview = { parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 18b014e4..4d552285 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/package.json b/package.json index 5b604977..ce862597 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "react-redux": "^9.0.4" }, "devDependencies": { + "@chromatic-com/storybook": "^3.2.2", "@storybook/addon-a11y": "^8.4.0", "@storybook/addon-essentials": "^8.4.0", "@storybook/blocks": "^8.4.0", diff --git a/yarn.lock b/yarn.lock index d5df0ce8..300f4580 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1639,6 +1639,21 @@ __metadata: languageName: node linkType: hard +"@chromatic-com/storybook@npm:^3.2.2": + version: 3.2.2 + resolution: "@chromatic-com/storybook@npm:3.2.2" + dependencies: + chromatic: "npm:^11.15.0" + filesize: "npm:^10.0.12" + jsonfile: "npm:^6.1.0" + react-confetti: "npm:^6.1.0" + strip-ansi: "npm:^7.1.0" + peerDependencies: + storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 + checksum: 10c0/7b8da1ddb399c804337ff28a28594b548392b7bead52f66615b98e201cdeb4d31184b9e355791ba5d0d8cfdd2bea7d38355ecd0058f26f4790f9a887107bde0f + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/aix-ppc64@npm:0.21.5" @@ -4178,7 +4193,7 @@ __metadata: languageName: node linkType: hard -"chromatic@npm:^11.18.1": +"chromatic@npm:^11.15.0, chromatic@npm:^11.18.1": version: 11.18.1 resolution: "chromatic@npm:11.18.1" peerDependencies: @@ -5457,6 +5472,13 @@ __metadata: languageName: node linkType: hard +"filesize@npm:^10.0.12": + version: 10.1.6 + resolution: "filesize@npm:10.1.6" + checksum: 10c0/9a196d64da4e947b8c0d294be09a3dfa7a634434a1fc5fb3465f1c9acc1237ea0363f245ba6e24477ea612754d942bc964d86e0e500905a72e9e0e17ae1bbdbc + languageName: node + linkType: hard + "fill-range@npm:^4.0.0": version: 4.0.0 resolution: "fill-range@npm:4.0.0" @@ -5839,7 +5861,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 @@ -6122,6 +6144,7 @@ __metadata: version: 0.0.0-use.local resolution: "intro-storybook-react-template@workspace:." dependencies: + "@chromatic-com/storybook": "npm:^3.2.2" "@reduxjs/toolkit": "npm:^2.0.1" "@storybook/addon-a11y": "npm:^8.4.0" "@storybook/addon-essentials": "npm:^8.4.0" @@ -6850,6 +6873,19 @@ __metadata: languageName: node linkType: hard +"jsonfile@npm:^6.1.0": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" + dependencies: + graceful-fs: "npm:^4.1.6" + universalify: "npm:^2.0.0" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10c0/4f95b5e8a5622b1e9e8f33c96b7ef3158122f595998114d1e7f03985649ea99cb3cd99ce1ed1831ae94c8c8543ab45ebd044207612f31a56fd08462140e46865 + languageName: node + linkType: hard + "jsx-ast-utils@npm:^2.4.1 || ^3.0.0": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" @@ -8075,6 +8111,17 @@ __metadata: languageName: node linkType: hard +"react-confetti@npm:^6.1.0": + version: 6.1.0 + resolution: "react-confetti@npm:6.1.0" + dependencies: + tween-functions: "npm:^1.2.0" + peerDependencies: + react: ^16.3.0 || ^17.0.1 || ^18.0.0 + checksum: 10c0/5b4eb23eef564695f6db1d25b294ed31d5fa21ff4092c6a38e641f85cd10e3e0b50014366e3ac0f7cf772e73faaecd14614e5b11a5531336fa769dda8068ab59 + languageName: node + linkType: hard + "react-docgen-typescript@npm:^2.2.2": version: 2.2.2 resolution: "react-docgen-typescript@npm:2.2.2" @@ -9195,7 +9242,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^7.0.1": +"strip-ansi@npm:^7.0.1, strip-ansi@npm:^7.1.0": version: 7.1.0 resolution: "strip-ansi@npm:7.1.0" dependencies: @@ -9536,6 +9583,13 @@ __metadata: languageName: node linkType: hard +"tween-functions@npm:^1.2.0": + version: 1.2.0 + resolution: "tween-functions@npm:1.2.0" + checksum: 10c0/7e59295b8b0ee4132ed2fe335f56a9db5c87056dad6b6fd3011be72239fd20398003ddb4403bc98ad9f5c94468890830f64016edbbde35581faf95b32cda8305 + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -9732,6 +9786,13 @@ __metadata: languageName: node linkType: hard +"universalify@npm:^2.0.0": + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: 10c0/73e8ee3809041ca8b818efb141801a1004e3fc0002727f1531f4de613ea281b494a40909596dae4a042a4fb6cd385af5d4db2e137b1362e0e91384b828effd3a + languageName: node + linkType: hard + "unplugin@npm:^1.3.1": version: 1.5.1 resolution: "unplugin@npm:1.5.1"