-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pie-lottie-player): DSW-2365 update visual test
- Loading branch information
1 parent
3cb1957
commit 144af95
Showing
3 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
11 changes: 10 additions & 1 deletion
11
packages/components/pie-lottie-player/test/visual/pie-lottie-player.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
|
||
import { readFile } from 'fs/promises'; | ||
import { test } from '@sand4rt/experimental-ct-web'; | ||
import percySnapshot from '@percy/playwright'; | ||
import { PieLottiePlayer, LottiePlayerProps } from '../../src/index.ts'; | ||
|
||
const animationData = JSON.parse(await readFile(new URL('../courier.json', import.meta.url), { encoding: 'utf-8' })); | ||
|
||
test.describe('PieLottiePlayer - Visual tests`', () => { | ||
test('should display the PieLottiePlayer component successfully', async ({ page, mount }) => { | ||
await mount(PieLottiePlayer, { | ||
props: {} as LottiePlayerProps, | ||
props: { | ||
animationData, | ||
} as LottiePlayerProps, | ||
}); | ||
|
||
// Ensure to snapshot always the first frame | ||
page.locator('pie-lottie-player') | ||
.evaluate((el:PieLottiePlayer) => el.stop()); | ||
|
||
await percySnapshot(page, 'PieLottiePlayer - Visual Test'); | ||
}); | ||
}); |