feat(dashboard): pick the banner game or turn the banner off
Build, Test & Push Frontend / quality-check (push) Successful in 13s
Build, Test & Push Frontend / docker (push) Successful in 24s

This commit is contained in:
lobo committed 2026-09-24 15:35:48 +02:00
1 parent 23e502bf5b
commit 83494519f9
11 files changed
+137 -23

No files matched your search

+15 -1
View File
@@ -94,7 +94,7 @@ describe('SettingsPage appearance', () => {
fireEvent.click(screen.getByRole('button', {name: 'SETTINGS.CORNER_OPTIONS.ROUND'}));
await waitFor(() => expect(appearancePuts()).toHaveLength(2));
expect(appearancePuts()[1]).toEqual({accent: 'green', corners: 'round', wideLayout: false, backgroundAppid: null});
expect(appearancePuts()[1]).toEqual({accent: 'green', corners: 'round', wideLayout: false, backgroundAppid: null, bannerAppid: null, showBanner: true});
expect(screen.getByRole('button', {name: 'SETTINGS.ACCENT_OPTIONS.GREEN'}).getAttribute('aria-pressed')).toBe('true');
expect(screen.getByRole('button', {name: 'SETTINGS.ACCENT_OPTIONS.VIOLET'}).getAttribute('aria-pressed')).toBe('false');
});
@@ -109,4 +109,18 @@ describe('SettingsPage appearance', () => {
expect(appearancePuts()[0].backgroundAppid).toBeNull();
expect(screen.getByText('SETTINGS.BACKGROUND_HINT')).toBeTruthy();
});
it('turns the banner off and goes back to the automatic banner', async () => {
localStorage.setItem('tbp_appearance', JSON.stringify({bannerAppid: 620}));
renderPage(profile());
fireEvent.click(await screen.findByRole('button', {name: 'SETTINGS.BANNER_AUTO'}));
await waitFor(() => expect(appearancePuts()).toHaveLength(1));
expect(appearancePuts()[0]).toMatchObject({bannerAppid: null, showBanner: true});
expect(screen.getByText('SETTINGS.BANNER_HINT')).toBeTruthy();
fireEvent.click(screen.getByRole('switch', {name: 'SETTINGS.BANNER'}));
await waitFor(() => expect(appearancePuts()).toHaveLength(2));
expect(appearancePuts()[1].showBanner).toBe(false);
});
});