Android v1 polish + Web UI flavor pass #65

Merged
bvandeusen merged 13 commits from dev into main 2026-06-01 20:17:49 -04:00
Showing only changes of commit 5b25f89c01 - Show all commits
+7 -3
View File
@@ -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();
});