diff --git a/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts b/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts index 9802f2686c..48dd68d78f 100644 --- a/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts +++ b/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts @@ -3,7 +3,7 @@ import { readFile } from 'fs/promises'; import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieLottiePlayer, LottiePlayerProps } from '../../src/index.ts'; -const animationData = JSON.parse(await readFile(new URL('./courier.json', import.meta.url), { encoding: 'utf-8' })); +const animationData = JSON.parse(await readFile(new URL('../courier.json', import.meta.url), { encoding: 'utf-8' })); const componentSelector = 'pie-lottie-player'; diff --git a/packages/components/pie-lottie-player/test/component/courier.json b/packages/components/pie-lottie-player/test/courier.json similarity index 100% rename from packages/components/pie-lottie-player/test/component/courier.json rename to packages/components/pie-lottie-player/test/courier.json diff --git a/packages/components/pie-lottie-player/test/visual/pie-lottie-player.spec.ts b/packages/components/pie-lottie-player/test/visual/pie-lottie-player.spec.ts index a5050e9cca..e1f7dbd7ba 100644 --- a/packages/components/pie-lottie-player/test/visual/pie-lottie-player.spec.ts +++ b/packages/components/pie-lottie-player/test/visual/pie-lottie-player.spec.ts @@ -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'); }); });