mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 02:14:05 +00:00
refactor(realtime, systemNotices, addons, airports, audit, categories, permissions, query-helpers, tags, transit, trip-membership): async DB-touching methods; transactions through UnitOfWork
This commit is contained in:
@@ -44,11 +44,11 @@ describe('AdminDefaultUserSettingsController', () => {
|
||||
expect(controller().c.get()).toEqual({ theme: 'dark' });
|
||||
});
|
||||
|
||||
it('DEFAULTS-002 PUT writes, audits, and answers with the STORED defaults', () => {
|
||||
it('DEFAULTS-002 PUT writes, audits, and answers with the STORED defaults', async () => {
|
||||
const { c, settings } = controller();
|
||||
// Not the request body: the service normalises and drops unknown keys, and the
|
||||
// admin panel renders straight from this response.
|
||||
expect(c.update(user, { theme: 'light' } as never, req)).toEqual({ theme: 'dark' });
|
||||
expect(await c.update(user, { theme: 'light' } as never, req)).toEqual({ theme: 'dark' });
|
||||
expect(settings.setAdminUserDefaults).toHaveBeenCalledWith({ theme: 'light' });
|
||||
expect(writeAudit).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ userId: 1, action: 'admin.default_user_settings_update', details: { theme: 'light' } }),
|
||||
|
||||
Reference in New Issue
Block a user