mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 23:35:44 +00:00
fix(album): localize track count on album detail header (#1245)
This commit is contained in:
@@ -106,6 +106,22 @@ describe('AlbumHeader genres', () => {
|
||||
expect(screen.getByRole('button', { name: 'Show all genres' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('localizes the track count in the info row', () => {
|
||||
renderWithProviders(
|
||||
<AlbumHeader
|
||||
{...baseProps()}
|
||||
songs={[
|
||||
{ id: 't1', duration: 100 } as unknown as SubsonicSong,
|
||||
{ id: 't2', duration: 200 } as unknown as SubsonicSong,
|
||||
]}
|
||||
info={albumInfo()}
|
||||
/>,
|
||||
{ language: 'nb' },
|
||||
);
|
||||
expect(screen.getByText(/2 spor/)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/Tracks/i)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('opens via keyboard with focus inside the menu, arrow-navigates, and restores focus on close', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(
|
||||
|
||||
@@ -339,7 +339,7 @@ export default function AlbumHeader({
|
||||
)}
|
||||
<div className="album-detail-info">
|
||||
{info.year && <span>{info.year}</span>}
|
||||
<span>· {songs.length} Tracks</span>
|
||||
<span>· {t('albumDetail.tracksCount', { n: songs.length })}</span>
|
||||
<span>· {formatLongDuration(totalDuration)}</span>
|
||||
{formatLabel && <span>· {formatLabel}</span>}
|
||||
{info.recordLabel && (
|
||||
|
||||
Reference in New Issue
Block a user