Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

test(dashboard): update activity test to ensure short activities are discarded and not displayed

Khuram Niazc9953fac4c75
diff --git a/e2e/dashboard.spec.ts b/e2e/dashboard.spec.ts
index 141eb8a..2046af0 100644
--- a/e2e/dashboard.spec.ts
+++ b/e2e/dashboard.spec.ts
@@ -156,10 +156,13 @@ test.describe("Dashboard page", () => {
).toBeVisible();
});
- test("should show a completed activity in the dashboard's recent activities list", async ({
+ test("should discard a very short activity and not show it in the dashboard's recent activities list", async ({
page,
cleanup,
}) => {
+ // Activities below ACTIVITY_MIN_DURATION_MINUTES are discarded on stop
+ // (src/context/ActivityContext.tsx), so a start immediately followed by
+ // a stop is deleted server-side rather than saved.
const taskTitle = uniqueName("E2E Dashboard Activity Task");
const activityType = uniqueName("E2E Dashboard Activity Type");
await navigateToTasks(page);
@@ -194,6 +197,6 @@ test.describe("Dashboard page", () => {
.getByTestId("recent-card-toggle-group")
.getByRole("button", { name: "Activities" })
.click();
- await expect(page.getByText(taskTitle, { exact: true })).toBeVisible();
+ await expect(page.getByText(taskTitle, { exact: true })).not.toBeVisible();
});
});