From 5b25f89c01c8db523b61c8be07217aec92bbfe87 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 1 Jun 2026 19:59:40 -0400 Subject: [PATCH] test(web): update AlbumCard test for dropped year line --- web/src/lib/components/AlbumCard.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/src/lib/components/AlbumCard.test.ts b/web/src/lib/components/AlbumCard.test.ts index 307c2b52..79d55b20 100644 --- a/web/src/lib/components/AlbumCard.test.ts +++ b/web/src/lib/components/AlbumCard.test.ts @@ -53,18 +53,22 @@ const album: AlbumRef = { afterEach(() => vi.clearAllMocks()); describe('AlbumCard', () => { - test('renders cover, title, year inside a link to /albums/:id', () => { + test('renders cover, title, artist inside a link to /albums/:id', () => { const { container } = render(AlbumCard, { props: { album } }); const link = screen.getByRole('link'); expect(link).toHaveAttribute('href', '/albums/xyz'); expect(link).toHaveTextContent('Kind of Blue'); - expect(link).toHaveTextContent('1959'); + expect(link).toHaveTextContent('Miles Davis'); + // The year is intentionally omitted from the Home tile — + // dropped in the visual polish pass; the album detail page + // still shows it. + expect(link).not.toHaveTextContent('1959'); const img = container.querySelector('img') as HTMLImageElement; expect(img.src).toContain('/api/albums/xyz/cover'); }); - test('year is omitted when not present', () => { + test('year is not rendered on the tile even when present', () => { render(AlbumCard, { props: { album: { ...album, year: undefined } } }); expect(screen.queryByText(/1959/)).not.toBeInTheDocument(); });