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 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5 committed 2026-08-02 09:16:00 +02:00
1 parent 32a259aea4
commit e1550489db
1 file changed
+4 -2
@@ -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,
};