diff --git a/.changeset/loud-turkeys-rest.md b/.changeset/loud-turkeys-rest.md new file mode 100644 index 0000000000..e123927818 --- /dev/null +++ b/.changeset/loud-turkeys-rest.md @@ -0,0 +1,5 @@ +--- +"@justeattakeaway/generator-pie-component": minor +--- + +[Updated] - structure to follow new testing best practices via rendering in Storybook diff --git a/apps/pie-storybook/.storybook/main.ts b/apps/pie-storybook/.storybook/main.ts index 1d1069d151..35e448f2f1 100644 --- a/apps/pie-storybook/.storybook/main.ts +++ b/apps/pie-storybook/.storybook/main.ts @@ -5,12 +5,11 @@ const isBrowserTesting = process.env.BROWSER_TESTING === 'true'; const config: StorybookConfig = { stories: isBrowserTesting ? [ - "../stories/**/*.test.mdx", - "../stories/**/*.test.stories.@(js|ts|tsx)" - ] + "../stories/testing/**/*.test.stories.ts" + ] : [ "../stories/**/*.mdx", - "../stories/**/!(*.test).stories.@(js|ts|tsx)" + "../stories/*.stories.@(js|ts|tsx)", ], addons: [ "@storybook/addon-essentials", diff --git a/apps/pie-storybook/.storybook/styles/component-status.scss b/apps/pie-storybook/.storybook/styles/component-status.scss index 7c0eaa9259..2219c80376 100644 --- a/apps/pie-storybook/.storybook/styles/component-status.scss +++ b/apps/pie-storybook/.storybook/styles/component-status.scss @@ -19,3 +19,9 @@ .c-componentStatus--top { inset-block-start: var(--dt-spacing-c); } + +@media only percy { + .percyHidden { + display: none; + } +} diff --git a/apps/pie-storybook/decorators/component-status.ts b/apps/pie-storybook/decorators/component-status.ts index bef6d50948..57bc7a07a2 100644 --- a/apps/pie-storybook/decorators/component-status.ts +++ b/apps/pie-storybook/decorators/component-status.ts @@ -26,7 +26,7 @@ export const ComponentStatus = (story: () => TemplateResult, storybookContext: S