Skip to content

Commit 3c7d29c

Browse files
test(e2e): Add dashboard stat card navigation test (#903)
* test(e2e): Add dashboard stat card navigation test Add E2E test verifying Quick Stats cards navigate to correct filtered URLs: - Open Issues → /issues?status=new,confirmed,in_progress,need_parts,need_help,wait_owner - Machines Needing Service → /m?status=unplayable,needs_service - Assigned to Me → /issues?assignee={uuid}&status=... Closes #891 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(e2e): Replace networkidle with element assertions Address Copilot review feedback: use element assertions instead of waitForLoadState("networkidle") to reduce flakiness. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 306847d commit 3c7d29c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

e2e/full/dashboard.spec.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,47 @@ test.describe.serial("Member Dashboard", () => {
110110
);
111111
});
112112

113+
test("stat cards navigate to filtered lists", async ({ page }, testInfo) => {
114+
await ensureLoggedIn(page, testInfo);
115+
116+
// Test 1: Click 'Open Issues' stat card
117+
const openIssuesCard = page
118+
.getByTestId("quick-stats")
119+
.getByRole("link")
120+
.filter({ hasText: "Open Issues" });
121+
await openIssuesCard.click();
122+
await expect(page).toHaveURL(
123+
/\/issues\?status=new,confirmed,in_progress,need_parts,need_help,wait_owner/
124+
);
125+
126+
// Navigate back to dashboard and wait for content
127+
await page.goto("/dashboard");
128+
await expect(page.getByTestId("quick-stats")).toBeVisible();
129+
130+
// Test 2: Click 'Machines Needing Service' stat card
131+
const machinesCard = page
132+
.getByTestId("quick-stats")
133+
.getByRole("link")
134+
.filter({ hasText: "Machines Needing Service" });
135+
await machinesCard.click();
136+
await expect(page).toHaveURL(/\/m\?status=unplayable,needs_service/);
137+
138+
// Navigate back to dashboard and wait for content
139+
await page.goto("/dashboard");
140+
await expect(page.getByTestId("quick-stats")).toBeVisible();
141+
142+
// Test 3: Click 'Assigned to Me' stat card (only visible when logged in)
143+
const assignedCard = page
144+
.getByTestId("quick-stats")
145+
.getByRole("link")
146+
.filter({ hasText: "Assigned to Me" });
147+
await assignedCard.click();
148+
// URL should contain assignee= with a UUID and the status filter
149+
await expect(page).toHaveURL(
150+
/\/issues\?assignee=[a-f0-9-]+&status=new,confirmed,in_progress,need_parts,need_help,wait_owner/
151+
);
152+
});
153+
113154
test("dashboard issue cards link to issue detail pages", async ({
114155
page,
115156
}, testInfo) => {

0 commit comments

Comments
 (0)