fix(web): update PlayerBar test for /now-playing cover link
test-web / test (push) Successful in 30s
test-web / test (push) Successful in 30s
CI on a2466b7d caught it: the cover/title area now links to
/now-playing per the NowPlaying landing, but PlayerBar.test.ts
still asserted /open album/i + href /albums/xyz. Rewritten test
asserts /open now playing/i + href /now-playing, with a comment
explaining the Spotify/YouTube Music pattern (album reachable via
the album-name link inside NowPlaying).
This commit is contained in:
@@ -92,14 +92,16 @@ beforeEach(() => {
|
||||
afterEach(() => vi.clearAllMocks());
|
||||
|
||||
describe('PlayerBar', () => {
|
||||
test('renders title, linked artist, linked cover', () => {
|
||||
test('renders title, artist, and cover linked to /now-playing', () => {
|
||||
render(PlayerBar);
|
||||
expect(compact().getByText('So What')).toBeInTheDocument();
|
||||
// The artist label sits under the title in compact (no link wrapper);
|
||||
// look for it as plain text.
|
||||
expect(compact().getByText('Miles Davis')).toBeInTheDocument();
|
||||
const cover = compact().getByRole('link', { name: /open album/i });
|
||||
expect(cover).toHaveAttribute('href', '/albums/xyz');
|
||||
// Cover + title area links to /now-playing (Spotify/YouTube Music
|
||||
// pattern). Album reachable via the album-name link inside NowPlaying.
|
||||
const cover = compact().getByRole('link', { name: /open now playing/i });
|
||||
expect(cover).toHaveAttribute('href', '/now-playing');
|
||||
});
|
||||
|
||||
test('play button click calls togglePlay', async () => {
|
||||
|
||||
Reference in New Issue
Block a user