Skip to content

Commit

Permalink
feat(pie-lottie-player): DSW-2365 update visual test
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandofranca committed Sep 2, 2024
1 parent 3cb1957 commit 144af95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
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');
});
});

0 comments on commit 144af95

Please sign in to comment.