Public Access
feat(dashboard): pick the banner game or turn the banner off
This commit is contained in:
1 parent
23e502bf5b
commit
83494519f9
11 files changed
+137
-23
No files matched your search
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user