From 3b3004986a340a17f5a10e4849b6a8302aadb86c Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 19:19:37 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- e2e/auth.spec.ts | 3 ++- src/app/api/goals/route.ts | 2 +- src/app/api/milestones/route.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/auth.spec.ts b/e2e/auth.spec.ts index c2bcfb4cf..aa3b9390a 100644 --- a/e2e/auth.spec.ts +++ b/e2e/auth.spec.ts @@ -74,4 +74,5 @@ test("[Auth E2E] landing page shows DevTrack feature section", async ({ // Features section or a recognised feature keyword must be present. const features = page.locator("#features"); await expect(features).toBeVisible(); -}); \ No newline at end of file +}); +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/src/app/api/goals/route.ts b/src/app/api/goals/route.ts index 0d616ebd3..b4b83346b 100644 --- a/src/app/api/goals/route.ts +++ b/src/app/api/goals/route.ts @@ -239,7 +239,7 @@ try { let safeDeadline: string | null = null; if (typeof deadline === "string") { const d = new Date(deadline); - if (!isNaN(d.getTime())) { + if (!Number.isNaN(d.getTime())) { d.setUTCHours(23, 59, 59, 999); safeDeadline = d.toISOString(); } diff --git a/src/app/api/milestones/route.ts b/src/app/api/milestones/route.ts index 4019a3d7f..19ec9c30c 100644 --- a/src/app/api/milestones/route.ts +++ b/src/app/api/milestones/route.ts @@ -92,7 +92,7 @@ export async function POST(req: Request) { ? unit.trim().slice(0, MAX_UNIT_LEN) : "units"; - if (typeof targetDate !== "string" || isNaN(new Date(targetDate).getTime())) { + if (typeof targetDate !== "string" || Number.isNaN(new Date(targetDate).getTime())) { return NextResponse.json({ error: "targetDate must be a valid date string" }, { status: 400 }); }