Skip to content

Commit

Permalink
chore: mask image test-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
naporin0624 committed Dec 25, 2024
1 parent a1eb60f commit 7345ceb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .storybook/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ const vrtTestConfig: TestRunnerConfig = {
async postVisit(page, context) {
await waitForPageReady(page)
await page.waitForTimeout(200)
const root = await page.$('#storybook-root')
if (!root) {
throw new Error('Root element not found')
}

const image = await page.screenshot()
const image = await root.screenshot({
animations: 'disabled',
mask: [page.locator('img')],
})
expect(image).toMatchImageSnapshot({
customSnapshotIdentifier: context.id,
customDiffDir: `${process.cwd()}/__diff_output__`,
Expand Down

0 comments on commit 7345ceb

Please sign in to comment.