diff --git a/e2e/dashboard-widgets.spec.js b/e2e/dashboard-widgets.spec.js
index 0ed5886a..3cd8e9fa 100644
--- a/e2e/dashboard-widgets.spec.js
+++ b/e2e/dashboard-widgets.spec.js
@@ -1,41 +1,36 @@
import { expect, test } from "@playwright/test";
import { encode } from "next-auth/jwt";
-
-const authSecret = "playwright-placeholder-secret-that-is-long-enough";
-
-test.beforeEach(async ({ page }) => {
- const sessionToken = await encode({
- secret: authSecret,
- token: {
- name: "Playwright User",
- email: "playwright@example.com",
- sub: "12345",
- githubLogin: "playwright-user",
- githubId: "12345",
- accessToken: "test-token",
- },
- maxAge: 60 * 60,
- cookieName: "next-auth.session-token",
+ 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.context().addCookies([
- {
- name: "next-auth.session-token",
- value: sessionToken,
- domain: "127.0.0.1",
- path: "/",
- httpOnly: true,
- sameSite: "Lax",
- secure: false,
- expires: Math.floor(Date.now() / 1000) + 60 * 60,
- },
- ]);
-
- await page.route("**/api/auth/session", async (route) => {
+ await page.route("**/api/notifications**", async (route) => {
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
- user: { name: "Playwright User", email: "playwright@example.com" },
+ notifications: [],
+ unreadCount: 0,
+ }),
+ });
+ });
githubLogin: "playwright-user",
githubId: "12345",
accessToken: "test-token",
@@ -88,6 +83,7 @@ test.beforeEach(async ({ page }) => {
unit: "commits",
recurrence: "weekly",
period_start: "2026-05-18",
+ last_synced_at: new Date().toISOString(),
},
],
}),
@@ -101,6 +97,7 @@ test.beforeEach(async ({ page }) => {
});
});
+<<<<<<< HEAD
await page.route("**/api/ai-insights**", async (route) => {
await route.fulfill({
contentType: "application/json",
@@ -133,6 +130,8 @@ test.beforeEach(async ({ page }) => {
});
});
+=======
+>>>>>>> d4b3909 (test(e2e): mock /api/goals/sync and mark mock goal as synced)
const metricRoutes = [
"**/api/metrics/prs**",
"**/api/metrics/pr-breakdown**",
diff --git a/src/app/auth/signin/page.tsx b/src/app/auth/signin/page.tsx
index 62f39d22..7f2c55cf 100644
--- a/src/app/auth/signin/page.tsx
+++ b/src/app/auth/signin/page.tsx
@@ -50,8 +50,6 @@ export default function SignInPage() {
}}
>