From 43f4db91120de8e716456f4fa9dd34edc8584657 Mon Sep 17 00:00:00 2001 From: Rudraksh Tank <24ucs052@lnmiit.ac.in> Date: Fri, 31 Jul 2026 18:47:09 +0530 Subject: [PATCH] Update streak.spec.ts --- e2e/streak.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/streak.spec.ts b/e2e/streak.spec.ts index bdd02d140..68c311078 100644 --- a/e2e/streak.spec.ts +++ b/e2e/streak.spec.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; import { encode } from "next-auth/jwt"; -import { mockMetricResponse } from "./helpers/dashboard-mocks"; +import { mockMetricResponse } from "./helpers/dashboard-mocks.js"; const authSecret = process.env.NEXTAUTH_SECRET || "test-nextauth-secret-for-playwright-tests"; @@ -180,9 +180,9 @@ test.describe("[Streak E2E]", () => { // Now scope to the nearest rounded-xl ancestor — the containerRef div // that wraps both the heading and the stats grid. - const section = streakHeading.locator( - 'xpath=ancestor::div[contains(@class,"rounded-xl")][1]' - ); + const section = page.locator('div.rounded-xl').filter({ + has: page.getByRole("heading", { name: "Commit Streaks" }) + }).first(); // The "Longest Streak" stat card contains the number as a raw text node // inside a div whose full text content is "21 days" (number + unit span).