refactor: track lengths and file sizes come from the shared formatters on Missing files, Duplicates, a want's Releases and the app download; an hour-long track reads 1:01:05, not 61:05 (M505 #5639 #5640)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 16:14:01 -04:00
co-authored by Claude Opus 5.5
parent 9e7d50b38e
commit 622f248ea2
7 changed files with 35 additions and 32 deletions
@@ -147,6 +147,19 @@ describe('/collection/missing', () => {
});
// The deciding fact for whether a missing file is worth chasing.
// The page's lengths come from the shared formatter: an hour-long track
// reads 1:01:05, not 61:05 (M505).
test('each track shows its length, hours and all', () => {
const long = structuredClone(response);
long.groups[1].tracks[0].duration_sec = 3665;
renderWith(long);
expect(screen.getAllByTestId('missing-track-length').map((el) => el.textContent?.trim())).toEqual([
'3:05',
'3:05',
'1:01:05'
]);
});
test('distinguishes a played track from one never played', () => {
renderWith(response);
expect(screen.getByText(/last played 2d ago/)).toBeTruthy();