Skip to content

Commit 80b4690

Browse files
committed
Adding unit tests
1 parent 7143318 commit 80b4690

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/routes/storage-test/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{#each list.items as item}
1616
<li>
1717
<DownloadLink ref={item} let:link let:ref>
18-
<a href="{link}" download>{ref?.name}</a>
18+
<a data-testid="download-link" href="{link}" download>{ref?.name}</a>
1919
</DownloadLink>
2020
</li>
2121
{/each}

tests/storage.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
4+
test('Renders download links', async ({ page }) => {
5+
await page.goto('/storage-test');
6+
await page.waitForSelector('[data-testid="download-link"]');
7+
const linksCount = await page.getByTestId('download-link').count()
8+
expect( linksCount ).toBeGreaterThan(0);
9+
});
10+

0 commit comments

Comments
 (0)