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
@@ -42,7 +42,7 @@ describe('useSaveAppearance', () => {
|
||||
const [url, request] = fetch.mock.calls[0];
|
||||
expect(url).toContain('/api/users/settings/appearance');
|
||||
expect(request.method).toBe('PUT');
|
||||
expect(JSON.parse(request.body)).toEqual({accent: 'blue', corners: 'default', wideLayout: false, backgroundAppid: null});
|
||||
expect(JSON.parse(request.body)).toEqual({accent: 'blue', corners: 'default', wideLayout: false, backgroundAppid: null, bannerAppid: null, showBanner: true});
|
||||
});
|
||||
|
||||
it('puts the old value back when Auth refuses', async () => {
|
||||
@@ -109,7 +109,7 @@ describe('useSaveAppearance', () => {
|
||||
});
|
||||
|
||||
it('waits for a running load from Auth, then keeps its values for the fields not changed here', async () => {
|
||||
const fromServer = {accent: 'green', corners: 'default', wideLayout: false, backgroundAppid: null};
|
||||
const fromServer = {accent: 'green', corners: 'default', wideLayout: false, backgroundAppid: null, bannerAppid: 620, showBanner: false};
|
||||
let answerMe;
|
||||
globalThis.fetch = vi.fn((url, init) => (init?.method === 'PUT'
|
||||
? Promise.resolve({ok: true, status: 204})
|
||||
@@ -196,7 +196,7 @@ describe('useSaveAppearance', () => {
|
||||
});
|
||||
|
||||
expect(result.current.preferences.appearance.corners).toBe('round');
|
||||
expect(puts()[2]).toEqual({accent: 'green', corners: 'round', wideLayout: true, backgroundAppid: null});
|
||||
expect(puts()[2]).toEqual({accent: 'green', corners: 'round', wideLayout: true, backgroundAppid: null, bannerAppid: null, showBanner: true});
|
||||
});
|
||||
|
||||
it('sends nothing for a change that waited for the load when a reset came first', async () => {
|
||||
|
||||
Reference in new issue
Block a user