Skip to content

Commit

Permalink
fix: test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
akash3gtm committed Mar 6, 2024
1 parent 95df0a6 commit aa02386
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/storybook/tests/example.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ for (const [key, value] of Object.entries(testData)) {
)}`, async ({ page }, testinfo) => {
await page.goto(storybookUrl);
if (overlay) await page.waitForTimeout(300);
testinfo.snapshotSuffix = '';
testinfo.snapshotSuffix = '-darwin';
expect(await page.screenshot()).toMatchSnapshot({
maxDiffPixels: 100,
});
Expand All @@ -109,14 +109,15 @@ for (const [key, value] of Object.entries(testData)) {
// case: typeOfTest === 'default'
// no args are passed, basic story will run

test(`${key} is displayed`, async ({ page }) => {
test(`${key} is displayed`, async ({ page }, testinfo) => {
const storybookUrl = path.join(
'file://',
__dirname,
`../storybook-static/iframe.html?args=&id=stories-${value.storyParent}-${value.storyAddress}--${value.storyName}&viewMode=story`
);
await page.goto(storybookUrl);
if (overlay) await page.waitForTimeout(300);
testinfo.snapshotSuffix = '-darwin';
expect(await page.screenshot()).toMatchSnapshot({
maxDiffPixels: 100,
});
Expand Down

0 comments on commit aa02386

Please sign in to comment.