Skip to content

Commit

Permalink
Merge branch 'valentin/unified-a11y-testing' into yann/add-a11y-addon…
Browse files Browse the repository at this point in the history
…-to-sandboxes
  • Loading branch information
kasperpeulen authored Dec 6, 2024
2 parents fd475c5 + aa40afa commit b86c24b
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 26 deletions.
7 changes: 4 additions & 3 deletions code/addons/a11y/src/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Source: https://github.com/chaance/vitest-axe/blob/main/src/to-have-no-violations.ts
import * as matchers from 'vitest-axe/matchers';

import type { StoryContext } from '@storybook/csf';
import type { AfterEach } from 'storybook/internal/types';

import { expect } from '@storybook/test';

import { run } from './a11yRunner';
Expand All @@ -12,12 +13,12 @@ import { getIsVitestRunning, getIsVitestStandaloneRun } from './utils';
expect.extend(matchers);

// eslint-disable-next-line @typescript-eslint/naming-convention
export const experimental_afterEach = async ({
export const experimental_afterEach: AfterEach<any> = async ({
reporting,
parameters,
globals,
tags,
}: StoryContext) => {
}) => {
const a11yParameter: A11yParameters | undefined = parameters.a11y;
const a11yGlobals = globals.a11y;
const warnings = a11yParameter?.warnings ?? [];
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"prep": "jiti ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/global": "^5.0.0",
"ts-dedent": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"prep": "jiti ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.12",
"@storybook/instrumenter": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ addons.register(ADDON_ID, (api) => {
api.setSelectedPanel('storybook/a11y/panel');
api.togglePanel(true);
},
// sidebarContextMenu: false, // TODO
sidebarContextMenu: false,
}
: null,
] as const;
Expand Down
2 changes: 1 addition & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
"prep": "jiti ./scripts/prep.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"better-opn": "^3.0.2",
"browser-assert": "^1.2.1",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0",
Expand Down
2 changes: 2 additions & 0 deletions code/core/src/types/modules/csf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ViewMode as ViewModeBase } from '@storybook/csf';
import type { Addon_OptionsParameter } from './addons';

export type {
AfterEach,
AnnotatedStoryFn,
Args,
ArgsEnhancer,
Expand All @@ -11,6 +12,7 @@ export type {
ArgTypes,
ArgTypesEnhancer,
BaseAnnotations,
BeforeEach,
Canvas,
ComponentAnnotations,
ComponentId,
Expand Down
2 changes: 1 addition & 1 deletion code/lib/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prep": "jiti ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/icons": "^1.2.12",
"ts-dedent": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@babel/preset-env": "^7.24.4",
"@babel/types": "^7.24.0",
"@storybook/core": "workspace:*",
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@types/cross-spawn": "^6.0.2",
"cross-spawn": "^7.0.3",
"es-toolkit": "^1.22.0",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/source-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"prep": "jiti ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"es-toolkit": "^1.22.0",
"estraverse": "^5.2.0",
"prettier": "^3.1.1"
Expand Down
2 changes: 1 addition & 1 deletion code/lib/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prep": "jiti ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/global": "^5.0.0",
"@storybook/instrumenter": "workspace:*",
"@testing-library/dom": "10.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"@storybook/codemod": "workspace:*",
"@storybook/core": "workspace:*",
"@storybook/core-webpack": "workspace:*",
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/csf-plugin": "workspace:*",
"@storybook/ember": "workspace:*",
"@storybook/eslint-config-storybook": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@storybook/components": "workspace:*",
"@storybook/csf": "0.1.12--canary.110.c6e6023.0",
"@storybook/csf": "0.1.12",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
Expand Down
26 changes: 13 additions & 13 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5905,7 +5905,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/addon-links@workspace:addons/links"
dependencies:
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/global": "npm:^5.0.0"
ts-dedent: "npm:^2.0.0"
typescript: "npm:^5.3.2"
Expand Down Expand Up @@ -6131,7 +6131,7 @@ __metadata:
resolution: "@storybook/blocks@workspace:lib/blocks"
dependencies:
"@storybook/addon-actions": "workspace:*"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/icons": "npm:^1.2.12"
"@storybook/react": "workspace:*"
"@storybook/test": "workspace:*"
Expand Down Expand Up @@ -6303,7 +6303,7 @@ __metadata:
"@babel/preset-env": "npm:^7.24.4"
"@babel/types": "npm:^7.24.0"
"@storybook/core": "workspace:*"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@types/cross-spawn": "npm:^6.0.2"
"@types/jscodeshift": "npm:^0.11.10"
ansi-regex: "npm:^6.0.1"
Expand Down Expand Up @@ -6399,7 +6399,7 @@ __metadata:
"@radix-ui/react-dialog": "npm:^1.0.5"
"@radix-ui/react-scroll-area": "npm:1.2.0-rc.7"
"@radix-ui/react-slot": "npm:^1.0.2"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/docs-mdx": "npm:4.0.0-next.1"
"@storybook/global": "npm:^5.0.0"
"@storybook/icons": "npm:^1.2.12"
Expand Down Expand Up @@ -6538,12 +6538,12 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/csf@npm:0.1.12--canary.110.c6e6023.0":
version: 0.1.12--canary.110.c6e6023.0
resolution: "@storybook/csf@npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf@npm:0.1.12":
version: 0.1.12
resolution: "@storybook/csf@npm:0.1.12"
dependencies:
type-fest: "npm:^2.19.0"
checksum: 10c0/c5acd62b03bd4beae4c12ff841a0b68b9b1806d3dfe7508050f907eda5e3fac84306f35d57d1be18a79e32980068c89d3b6979be8e81656f48fa2436e5696318
checksum: 10c0/3d96a976ada67eb683279338d1eb6aa730b228107d4c4f6616ea7b94061899c1fdc11957a756e7bc0708d18cb39af0010c865d124efd84559cd82dcb2d8bc959
languageName: node
linkType: hard

Expand Down Expand Up @@ -6610,7 +6610,7 @@ __metadata:
resolution: "@storybook/experimental-addon-test@workspace:addons/test"
dependencies:
"@devtools-ds/object-inspector": "npm:^1.1.2"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/global": "npm:^5.0.0"
"@storybook/icons": "npm:^1.2.12"
"@storybook/instrumenter": "workspace:*"
Expand Down Expand Up @@ -7262,7 +7262,7 @@ __metadata:
"@storybook/codemod": "workspace:*"
"@storybook/core": "workspace:*"
"@storybook/core-webpack": "workspace:*"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/csf-plugin": "workspace:*"
"@storybook/ember": "workspace:*"
"@storybook/eslint-config-storybook": "npm:^4.0.0"
Expand Down Expand Up @@ -7408,7 +7408,7 @@ __metadata:
resolution: "@storybook/server@workspace:renderers/server"
dependencies:
"@storybook/components": "workspace:*"
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/global": "npm:^5.0.0"
"@storybook/manager-api": "workspace:*"
"@storybook/preview-api": "workspace:*"
Expand All @@ -7425,7 +7425,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/source-loader@workspace:lib/source-loader"
dependencies:
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
es-toolkit: "npm:^1.22.0"
estraverse: "npm:^5.2.0"
prettier: "npm:^3.1.1"
Expand Down Expand Up @@ -7539,7 +7539,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/test@workspace:lib/test"
dependencies:
"@storybook/csf": "npm:0.1.12--canary.110.c6e6023.0"
"@storybook/csf": "npm:0.1.12"
"@storybook/global": "npm:^5.0.0"
"@storybook/instrumenter": "workspace:*"
"@testing-library/dom": "npm:10.4.0"
Expand Down

0 comments on commit b86c24b

Please sign in to comment.