The client address list test for the last-seen time keeps a margin from the rounding boundary #391

Closed
opened 2026-11-12 16:55:22 -05:00 by claude · 0 comments
Owner

The fixture in src/angular/src/app/features/clients/addresses/client-address-list/client-address-list.component.spec.ts (line 29) returns "now minus exactly two minutes" on each read, and line 118 expects 'Last 2 min ago'. It has the same shape as the fixture that failed in #387.

  • Today it cannot fail: the getter runs before the component calls formatRelativeTime(instant) (client-address-list.component.ts:136), so the elapsed time is at or above 120 s.
  • It breaks as soon as the getter is read after the component's clock, for example on a second change-detection pass: 119.999 s floors to "1 min ago".

Fix

  • Give the fixture the same 30-second margin as #387 (two minutes and 30 seconds ago) with a comment that says why.
  • Search the other *.spec.ts files for an exact-boundary instant measured against formatRelativeTime or another flooring helper and give each the same margin.

Done when

  • No console spec asserts a relative time from an instant that sits exactly on a rounding boundary.
The fixture in `src/angular/src/app/features/clients/addresses/client-address-list/client-address-list.component.spec.ts` (line 29) returns "now minus exactly two minutes" on each read, and line 118 expects `'Last 2 min ago'`. It has the same shape as the fixture that failed in #387. - Today it cannot fail: the getter runs before the component calls `formatRelativeTime(instant)` (`client-address-list.component.ts:136`), so the elapsed time is at or above 120 s. - It breaks as soon as the getter is read after the component's clock, for example on a second change-detection pass: 119.999 s floors to "1 min ago". **Fix** - Give the fixture the same 30-second margin as #387 (two minutes and 30 seconds ago) with a comment that says why. - Search the other `*.spec.ts` files for an exact-boundary instant measured against `formatRelativeTime` or another flooring helper and give each the same margin. **Done when** - No console spec asserts a relative time from an instant that sits exactly on a rounding boundary.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#391
No description provided.