Skip to content

Commit

Permalink
test(dashboard): add preliminary dashboard test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhthomas committed Nov 15, 2023
1 parent efe021d commit 6249415
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/components/dashboard/BasicSummary.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export let data: BasicSummaryEntry;
</script>

<Card class="shadow-sm !p-4">
<Card class="summary-card shadow-sm !p-4">
<div class="space-y-2">
<h4 class="h4">{data.title}</h4>
<h3 class="h3">{data.valueParsed}</h3>
Expand Down
13 changes: 13 additions & 0 deletions tests/dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect, test } from '@playwright/test';

test('Summary Cards Visible', async ({ page }) => {
await page.goto('/');

const main = await page.getByRole('main');
await expect(main).toBeVisible();

const summaryCards = await page.locator('.summary-card');

await expect(summaryCards).toHaveCount(2);
await expect(summaryCards.nth(0)).toBeVisible();
});

0 comments on commit 6249415

Please sign in to comment.