diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index 107f1537..922f430e 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -1,4 +1,4 @@ -import { waitForPageReady, TestRunnerConfig } from '@storybook/test-runner'; +import { TestRunnerConfig } from '@storybook/test-runner'; import { toMatchImageSnapshot } from 'jest-image-snapshot'; @@ -13,24 +13,11 @@ const config: TestRunnerConfig = { setup() { expect.extend({ toMatchImageSnapshot }); }, - async postVisit(page, context) { + async postVisit(page) { const elementHandler = await page.$('#storybook-root'); const innerHTML = await elementHandler?.innerHTML(); if (!innerHTML) throw new Error('No innerHTML found'); expect(innerHTML).toMatchSnapshot(); - - /** - * Disabling for now pending Chromatic on github - */ - - // // Waits for the page to be ready before taking a screenshot to ensure consistent results - // await waitForPageReady(page); - - // // To capture a screenshot for for different browsers, add page.context().browser().browserType().name() to get the browser name to prefix the file name - // const image = await page.screenshot(); - // expect(image).toMatchImageSnapshot({ - // customSnapshotIdentifier: context.id, - // }); }, };