Skip to content

Commit 6fd5b91

Browse files
Merge pull request #4 from PascalHonegger/snapshot-tests
feat(test): add snapshot tests
2 parents 17fac05 + 35f2f92 commit 6fd5b91

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ node_modules
33
/build
44
/.svelte-kit
55
/package
6+
/test-results
67
.env
78
.env.*
89
!.env.example
10+
.pnpm-store

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"preview": "vite preview",
99
"postinstall": "svelte-kit sync",
1010
"test": "playwright test",
11+
"test:update": "playwright test --update-snapshots",
1112
"check": "svelte-check --tsconfig ./tsconfig.json",
1213
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
1314
"lint": "prettier --check --plugin-search-dir=. . && eslint .",

tests/test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,18 @@ test('navigation between pages works', async ({ page }) => {
5555
await about.click();
5656
await expect(page).toHaveURL('/');
5757
});
58+
59+
test('index page snapshot', async ({ page }) => {
60+
await page.goto('/');
61+
await expect(page).toHaveScreenshot('index.png');
62+
});
63+
64+
test('setup page snapshot', async ({ page }) => {
65+
await page.goto('/setup');
66+
await expect(page).toHaveScreenshot('setup.png');
67+
});
68+
69+
test('projects page snapshot', async ({ page }) => {
70+
await page.goto('/projects');
71+
await expect(page).toHaveScreenshot('projects.png');
72+
});
520 KB
Loading
524 KB
Loading
525 KB
Loading

0 commit comments

Comments
 (0)