Public Access
feat(settings): reduce animations switch
This commit is contained in:
1 parent
fa0857f55d
commit
2ec5833f29
9 files changed
+88
-12
No files matched your search
@@ -187,11 +187,20 @@ describe('SettingsPage appearance', () => {
|
||||
fireEvent.click(appearanceCard().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, bannerAppid: null, showBanner: true});
|
||||
expect(appearancePuts()[1]).toEqual({accent: 'green', corners: 'round', wideLayout: false, backgroundAppid: null, bannerAppid: null, showBanner: true, reduceMotion: false});
|
||||
expect(appearanceCard().getByRole('button', {name: 'SETTINGS.ACCENT_OPTIONS.GREEN'}).getAttribute('aria-pressed')).toBe('true');
|
||||
expect(appearanceCard().getByRole('button', {name: 'SETTINGS.ACCENT_OPTIONS.VIOLET'}).getAttribute('aria-pressed')).toBe('false');
|
||||
});
|
||||
|
||||
it('saves the reduce animations switch', async () => {
|
||||
renderPage(profile());
|
||||
|
||||
fireEvent.click(await screen.findByRole('switch', {name: 'SETTINGS.REDUCE_MOTION'}));
|
||||
|
||||
await waitFor(() => expect(appearancePuts()).toHaveLength(1));
|
||||
expect(appearancePuts()[0].reduceMotion).toBe(true);
|
||||
});
|
||||
|
||||
it('removes the background', async () => {
|
||||
localStorage.setItem('tbp_appearance', JSON.stringify({backgroundAppid: 620}));
|
||||
renderPage(profile());
|
||||
|
||||
Reference in new issue
Block a user