fix(album): localize track count on album detail header (#1245)

This commit is contained in:
cucadmuh
2026-07-06 12:28:49 +03:00
committed by GitHub
parent c8d2a55e86
commit a0c8da073b
2 changed files with 17 additions and 1 deletions
@@ -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 && (