mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
fix(server): phase 1 review follow-ups — awaited returns, logged upload-filter rejections, covered handshake/notice branches, call-graph gate in CI, dead test imports
This commit is contained in:
@@ -80,4 +80,15 @@ describe('AdminDefaultUserSettingsController', () => {
|
||||
it('DEFAULTS-005 the class is listed in its module controllers', () => {
|
||||
expectRegisteredController(SettingsModule, AdminDefaultUserSettingsController);
|
||||
});
|
||||
|
||||
it('DEFAULTS-006 a rejected read-back after a successful write is still a 400, not a 500', async () => {
|
||||
const { c, settings } = controller({
|
||||
getAdminUserDefaults: vi.fn(() => Promise.reject(new Error('read-back failed'))),
|
||||
} as Partial<SettingsService>);
|
||||
expect(await thrown(() => c.update(user, { theme: 'light' } as never, req))).toEqual({
|
||||
status: 400,
|
||||
body: { error: 'read-back failed' },
|
||||
});
|
||||
expect(settings.setAdminUserDefaults).toHaveBeenCalledWith({ theme: 'light' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user