fix(downloads): label season view toggles

This commit is contained in:
4gray committed 2026-08-02 16:27:23 +02:00
1 parent beba983255
commit 3ccc13f852
2 files changed
+24

No files matched your search

@@ -612,6 +612,28 @@ describe('SeasonContainerComponent', () => {
);
});
it('gives the grid and list view radios localized accessible names', () => {
TestBed.inject(TranslateService).setTranslation(
'en',
{
PORTALS: {
GRID_VIEW: 'Grid view',
LIST_VIEW: 'List view',
},
},
true
);
setRequiredInputs({ '1': [createEpisode()] });
fixture.detectChanges();
const viewModeRadios = Array.from(
fixture.nativeElement.querySelectorAll('button[role="radio"]')
) as HTMLButtonElement[];
expect(
viewModeRadios.map((radio) => radio.getAttribute('aria-label'))
).toEqual(['Grid view', 'List view']);
});
it('disables the season action until authoritative eligible work exists and while work is in flight', async () => {
const first = createEpisode();
enableDownloads();
@@ -51,12 +51,14 @@
>
<mat-button-toggle
value="grid"
[aria-label]="'PORTALS.GRID_VIEW' | translate"
[matTooltip]="'PORTALS.GRID_VIEW' | translate"
>
<mat-icon>grid_view</mat-icon>
</mat-button-toggle>
<mat-button-toggle
value="list"
[aria-label]="'PORTALS.LIST_VIEW' | translate"
[matTooltip]="'PORTALS.LIST_VIEW' | translate"
>
<mat-icon>view_list</mat-icon>