diff --git a/code/addons/docs/template/stories/docspage/error.stories.ts b/code/addons/docs/template/stories/docspage/error.stories.ts index c0194422a0df..545448902b6c 100644 --- a/code/addons/docs/template/stories/docspage/error.stories.ts +++ b/code/addons/docs/template/stories/docspage/error.stories.ts @@ -2,7 +2,7 @@ import { global as globalThis } from '@storybook/global'; export default { component: globalThis.Components.Button, - tags: ['autodocs'], + tags: ['autodocs', '!test'], args: { label: 'Click Me!' }, parameters: { chromatic: { disable: true } }, }; @@ -12,10 +12,7 @@ export default { */ export const ErrorStory = { decorators: [ - (storyFn) => { - // Don't throw in the test runner; there's no easy way to skip (yet) - if (window?.navigator?.userAgent?.match(/StorybookTestRunner/)) return storyFn(); - + () => { throw new Error('Story did something wrong'); }, ], diff --git a/code/addons/interactions/template/stories/unhandled-errors.stories.ts b/code/addons/interactions/template/stories/unhandled-errors.stories.ts index dad3ce89ce8d..0daa0850584b 100644 --- a/code/addons/interactions/template/stories/unhandled-errors.stories.ts +++ b/code/addons/interactions/template/stories/unhandled-errors.stories.ts @@ -13,7 +13,7 @@ export default { actions: { argTypesRegex: '^on[A-Z].*' }, chromatic: { disable: true }, }, - tags: ['test-skip'], + tags: ['!test'], }; export const Default = { diff --git a/code/core/template/stories/rendering.stories.ts b/code/core/template/stories/rendering.stories.ts index f197d4078a77..0ca4976ec2c2 100644 --- a/code/core/template/stories/rendering.stories.ts +++ b/code/core/template/stories/rendering.stories.ts @@ -24,9 +24,6 @@ export const ForceRemount = { */ parameters: { chromatic: { disableSnapshot: true } }, play: async ({ canvasElement, id }: PlayFunctionContext) => { - if (window?.navigator.userAgent.match(/StorybookTestRunner/)) { - return; - } const channel = globalThis.__STORYBOOK_ADDONS_CHANNEL__; const button = await within(canvasElement).findByRole('button'); @@ -39,6 +36,7 @@ export const ForceRemount = { // By forcing the component to remount, we reset the focus state await channel.emit(FORCE_REMOUNT, { storyId: id }); }, + tags: ['!test'], }; export const ChangeArgs = { diff --git a/code/frameworks/nextjs/template/stories/RSC.stories.jsx b/code/frameworks/nextjs/template/stories/RSC.stories.jsx index e14456b50e58..505c6a3acab4 100644 --- a/code/frameworks/nextjs/template/stories/RSC.stories.jsx +++ b/code/frameworks/nextjs/template/stories/RSC.stories.jsx @@ -9,7 +9,7 @@ export default { export const Default = {}; export const DisableRSC = { - tags: ['test-skip'], + tags: ['!test'], parameters: { chromatic: { disable: true }, nextjs: { rsc: false }, @@ -17,7 +17,7 @@ export const DisableRSC = { }; export const Error = { - tags: ['test-skip'], + tags: ['!test'], parameters: { chromatic: { disable: true }, }, diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx index f76d8a7f5a90..05f4d5a68eab 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx @@ -44,6 +44,7 @@ export default { }, }, }, + tags: ['!test'], } as Meta; export const SingletonStateGetsInvalidatedAfterRedirecting: StoryObj = { diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx index 21a911a08ac1..24f199f89ce2 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx @@ -31,7 +31,7 @@ function Component() { export default { component: Component, - tags: ['test-skip'], + tags: ['!test'], parameters: { nextjs: { appDirectory: true, diff --git a/code/lib/blocks/src/blocks/ArgTypes.stories.tsx b/code/lib/blocks/src/blocks/ArgTypes.stories.tsx index 509497af2be1..39d4a1c66b9c 100644 --- a/code/lib/blocks/src/blocks/ArgTypes.stories.tsx +++ b/code/lib/blocks/src/blocks/ArgTypes.stories.tsx @@ -49,7 +49,7 @@ export const OfUndefined: Story = { of: ExampleStories.NotDefined, }, parameters: { chromatic: { disableSnapshot: true } }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const OfStoryUnattached: Story = { diff --git a/code/lib/blocks/src/blocks/Canvas.stories.tsx b/code/lib/blocks/src/blocks/Canvas.stories.tsx index bc5f889b995a..ac32440ba608 100644 --- a/code/lib/blocks/src/blocks/Canvas.stories.tsx +++ b/code/lib/blocks/src/blocks/Canvas.stories.tsx @@ -61,7 +61,7 @@ export const OfUndefined: Story = { of: ButtonStories.NotDefined, }, parameters: { chromatic: { disableSnapshot: true } }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const PropWithToolbar: Story = { diff --git a/code/lib/blocks/src/blocks/Controls.stories.tsx b/code/lib/blocks/src/blocks/Controls.stories.tsx index 598485dd93a6..b004b08bd614 100644 --- a/code/lib/blocks/src/blocks/Controls.stories.tsx +++ b/code/lib/blocks/src/blocks/Controls.stories.tsx @@ -46,7 +46,7 @@ export const OfUndefined: Story = { of: ExampleStories.NotDefined, }, parameters: { chromatic: { disableSnapshot: true } }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const IncludeProp: Story = { diff --git a/code/lib/blocks/src/blocks/Description.stories.tsx b/code/lib/blocks/src/blocks/Description.stories.tsx index a00a22f7a0b5..d57d808ff554 100644 --- a/code/lib/blocks/src/blocks/Description.stories.tsx +++ b/code/lib/blocks/src/blocks/Description.stories.tsx @@ -121,7 +121,7 @@ export const OfUndefinedAttached: Story = { relativeCsfPaths: ['../examples/Button.stories'], attached: true, }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const OfStringComponentAttached: Story = { name: 'Of "component" Attached', diff --git a/code/lib/blocks/src/blocks/Source.stories.tsx b/code/lib/blocks/src/blocks/Source.stories.tsx index 4fffbbd0a9e0..70d85b9d40bd 100644 --- a/code/lib/blocks/src/blocks/Source.stories.tsx +++ b/code/lib/blocks/src/blocks/Source.stories.tsx @@ -66,7 +66,7 @@ export const OfUndefined: Story = { of: ParametersStories.NotDefined, }, parameters: { chromatic: { disableSnapshot: true } }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const OfTypeProp: Story = { diff --git a/code/lib/blocks/src/blocks/Story.stories.tsx b/code/lib/blocks/src/blocks/Story.stories.tsx index 6dcd2bfa9fb7..27d0770395a2 100644 --- a/code/lib/blocks/src/blocks/Story.stories.tsx +++ b/code/lib/blocks/src/blocks/Story.stories.tsx @@ -54,7 +54,7 @@ export const OfUndefined: Story = { of: ButtonStories.NotDefined, }, parameters: { chromatic: { disableSnapshot: true } }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const Inline: Story = { diff --git a/code/lib/blocks/src/blocks/Subtitle.stories.tsx b/code/lib/blocks/src/blocks/Subtitle.stories.tsx index 6ee1e865baba..77accb6d447a 100644 --- a/code/lib/blocks/src/blocks/Subtitle.stories.tsx +++ b/code/lib/blocks/src/blocks/Subtitle.stories.tsx @@ -89,7 +89,7 @@ export const OfUndefinedAttached: Story = { relativeCsfPaths: ['../examples/Button.stories'], attached: true, }, - decorators: [(s) => (window?.navigator.userAgent.match(/StorybookTestRunner/) ?
: s())], + tags: ['!test'], }; export const OfStringMetaAttached: Story = { name: 'Of "meta" Attached', diff --git a/code/renderers/react/template/stories/errors.stories.tsx b/code/renderers/react/template/stories/errors.stories.tsx index cdbe1f5df662..8db00f803d68 100644 --- a/code/renderers/react/template/stories/errors.stories.tsx +++ b/code/renderers/react/template/stories/errors.stories.tsx @@ -8,10 +8,7 @@ export default { parameters: { chromatic: { disable: true }, }, - decorators: [ - // Skip errors if we are running in the test runner - (storyFn: any) => window?.navigator?.userAgent?.match(/StorybookTestRunner/) || storyFn(), - ], + tags: ['!test'], }; export const RenderThrows = { diff --git a/scripts/tasks/test-runner-build.ts b/scripts/tasks/test-runner-build.ts index b8249a091a49..5c273e1f8dcc 100644 --- a/scripts/tasks/test-runner-build.ts +++ b/scripts/tasks/test-runner-build.ts @@ -17,7 +17,6 @@ export const testRunnerBuild: Task & { port: number } = { '--junit', '--maxWorkers=2', '--failOnConsole', - '--skipTags="test-skip"', '--index-json', ];