Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions e2e/dashboard-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test.beforeEach(async ({ page }) => {
accessToken: "test-token",
},
maxAge: 60 * 60,
cookieName: "next-auth.session-token",
});

await page.context().addCookies([
Expand Down Expand Up @@ -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**",
Expand Down
Loading