From ecd8404e662d044ab8295f86a8163b7ef15fd066 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Sun, 6 Dec 2026 04:17:49 +0800 Subject: [PATCH] test(svn): pick a Last Week revision that is last week on any weekday (#8290) The M10 test dated its revision eight days back, which is two weeks back on a Sunday, so it failed every Sunday. It now uses Wednesday noon of last week. --- src/features/vcs/__tests__/svnToolWindowParity.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/vcs/__tests__/svnToolWindowParity.test.tsx b/src/features/vcs/__tests__/svnToolWindowParity.test.tsx index 671e9381f8..f2bf06aaa1 100644 --- a/src/features/vcs/__tests__/svnToolWindowParity.test.tsx +++ b/src/features/vcs/__tests__/svnToolWindowParity.test.tsx @@ -897,7 +897,10 @@ describe("Incoming", () => { }); it("M10: follows the UI's language", async () => { - mocks.svnIncomingRevisions.mockResolvedValue(ok([revision(A, 7, Date.now() - 8 * DAY)])); + // Wednesday noon of last week: "now minus 8 days" falls two weeks back on a Sunday. + const today = new Date(); + const lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() - 4, 12); + mocks.svnIncomingRevisions.mockResolvedValue(ok([revision(A, 7, lastWeek.getTime())])); render(); await screen.findByText("change 7"); expect(screen.getByText("Last Week")).toBeInTheDocument();