mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 22:16:26 +00:00
test(server): follow the signatures the session and port work changed
The session gate passes a session lookup to verifyJwtAndLoadUser, the Immich save takes auto_upload, getAppUrl stays synchronous, the demo session list marks the current session by the id it is handed, and the lease no longer needs a transaction of its own, so its spec is gone.
This commit is contained in:
@@ -185,7 +185,12 @@ describe('applyPlatformUploads', () => {
|
||||
res,
|
||||
next,
|
||||
);
|
||||
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('jwt123', expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }));
|
||||
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith(
|
||||
'jwt123',
|
||||
expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }),
|
||||
// the session gate's lookup (UserSessionsRepository)
|
||||
expect.objectContaining({ findActive: expect.any(Function), touchLastSeen: expect.any(Function) }),
|
||||
);
|
||||
expect(h.sendToResponse).toHaveBeenCalledWith('photos', 'a.jpg', res);
|
||||
});
|
||||
|
||||
@@ -195,7 +200,12 @@ describe('applyPlatformUploads', () => {
|
||||
h.verifyJwtAndLoadUser.mockReturnValue({ id: 1 });
|
||||
const res = makeRes();
|
||||
await photoHandler()({ params: { filename: 'a.jpg' }, headers: {}, query: { token: 'qtok' } }, res, next);
|
||||
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('qtok', expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }));
|
||||
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith(
|
||||
'qtok',
|
||||
expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }),
|
||||
// the session gate's lookup (UserSessionsRepository)
|
||||
expect.objectContaining({ findActive: expect.any(Function), touchLastSeen: expect.any(Function) }),
|
||||
);
|
||||
expect(h.sendToResponse).toHaveBeenCalledWith('photos', 'a.jpg', res);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user