From 624941578ddbbd7318ddc27d58227cca8abf9cad Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Tue, 14 Nov 2023 20:37:00 -0500 Subject: [PATCH] test(dashboard): add preliminary dashboard test --- src/lib/components/dashboard/BasicSummary.svelte | 2 +- tests/dashboard.spec.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/dashboard.spec.ts diff --git a/src/lib/components/dashboard/BasicSummary.svelte b/src/lib/components/dashboard/BasicSummary.svelte index ef160eb..3b3fa96 100644 --- a/src/lib/components/dashboard/BasicSummary.svelte +++ b/src/lib/components/dashboard/BasicSummary.svelte @@ -6,7 +6,7 @@ export let data: BasicSummaryEntry; - +

{data.title}

{data.valueParsed}

diff --git a/tests/dashboard.spec.ts b/tests/dashboard.spec.ts new file mode 100644 index 0000000..e7115b5 --- /dev/null +++ b/tests/dashboard.spec.ts @@ -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(); +});