Skip to content

Commit

Permalink
Remove commented visual testing code as setting up chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSpencer committed Jan 19, 2024
1 parent 2230a8a commit 424d98c
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { waitForPageReady, TestRunnerConfig } from '@storybook/test-runner';
import { TestRunnerConfig } from '@storybook/test-runner';

import { toMatchImageSnapshot } from 'jest-image-snapshot';

Expand All @@ -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,
// });
},
};

Expand Down

0 comments on commit 424d98c

Please sign in to comment.