From e1550489dbbf4ee4c0ae3e1be0723367eb1d27e5 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 1 Aug 2026 20:19:23 +0200 Subject: [PATCH] test(stalker): pin account-info expiry fixture below the day boundary Math.round on the epoch could round up half a second, putting the fixture's expiry just past the 30-day mark so daysLeft ceil'd to 31 on CI. Floor keeps the interval strictly inside 30 days regardless of when within the second the spec runs. Co-Authored-By: Claude Opus 5 --- .../stalker-account-info.component.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/portal/stalker/feature/src/lib/stalker-account-info/stalker-account-info.component.spec.ts b/libs/portal/stalker/feature/src/lib/stalker-account-info/stalker-account-info.component.spec.ts index 67191a626..58449c15f 100644 --- a/libs/portal/stalker/feature/src/lib/stalker-account-info/stalker-account-info.component.spec.ts +++ b/libs/portal/stalker/feature/src/lib/stalker-account-info/stalker-account-info.component.spec.ts @@ -26,14 +26,16 @@ describe('StalkerAccountInfoComponent', () => { const freshSnapshot = { login: 'user-42', - expireDate: Math.round(Date.now() / 1000) + 30 * 86_400, + // floor, not round: rounding the epoch up puts the expiry a few + // hundred ms past the 30-day mark and ceil() then yields 31. + expireDate: Math.floor(Date.now() / 1000) + 30 * 86_400, tariffPlanName: 'Premium', status: 1, }; const cachedSnapshot = { login: 'cached-user', - expireDate: Math.round(Date.now() / 1000) + 3 * 86_400, + expireDate: Math.floor(Date.now() / 1000) + 3 * 86_400, tariffPlanName: 'Basic', status: 1, };