From dd8f9bfec26fd5ca086165d4d5b0e5f1aef8162c Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 25 May 2026 07:46:51 +0530 Subject: [PATCH 1/2] chore: add test script to package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 8dbab4ec..2bb6df5d 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "start": "next start", "lint": "next lint", "type-check": "tsc --noEmit", + "test": "vitest run", "test:e2e": "playwright test" }, "dependencies": { From 72c71a3b2d92b60dbd39cd1a2f2597195f453953 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 25 May 2026 08:11:54 +0530 Subject: [PATCH 2/2] fix: add missing E2E dashboard widget mocks --- e2e/dashboard-widgets.spec.js | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/e2e/dashboard-widgets.spec.js b/e2e/dashboard-widgets.spec.js index 40ab6562..7ec3ee59 100644 --- a/e2e/dashboard-widgets.spec.js +++ b/e2e/dashboard-widgets.spec.js @@ -15,6 +15,7 @@ test.beforeEach(async ({ page }) => { accessToken: "test-token", }, maxAge: 60 * 60, + cookieName: "next-auth.session-token", }); await page.context().addCookies([ @@ -93,6 +94,45 @@ test.beforeEach(async ({ page }) => { }); }); + await page.route("**/api/goals/sync", async (route) => { + await route.fulfill({ + contentType: "application/json", + body: JSON.stringify({ updated: 1, commitCount: 4 }), + }); + }); + + await page.route("**/api/ai-insights**", async (route) => { + await route.fulfill({ + contentType: "application/json", + body: JSON.stringify({ + data: { + insights: [ + { + id: "insight-1", + type: "productivity", + title: "High Consistency", + description: "You have coded 5 days this week!", + severity: "positive", + }, + ], + trend: { direction: "up", percentage: 15 }, + aiSummary: "Great job shipping features this week. Keep up the high standard!", + generatedAt: "2026-05-18T12:00:00.000Z", + }, + }), + }); + }); + + await page.route("**/api/notifications**", async (route) => { + await route.fulfill({ + contentType: "application/json", + body: JSON.stringify({ + notifications: [], + unreadCount: 0, + }), + }); + }); + const metricRoutes = [ "**/api/metrics/prs**", "**/api/metrics/pr-breakdown**",