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:
Maurice
2026-10-08 20:22:16 +02:00
parent 37af6f4ff9
commit da97d7535f
6 changed files with 27 additions and 34 deletions
@@ -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);
});