mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 00:43:15 +00:00
test(journey): pin the capture hint through the upload routes and the shared contract
This commit is contained in:
@@ -199,10 +199,20 @@ describe('JourneyController', () => {
|
||||
]);
|
||||
// The client uploads one file per request, so a refresh per upload would
|
||||
// reload every open client once per photo: uploads backfill and stay quiet.
|
||||
// No capture fields came along, so no hint does either (#3120).
|
||||
expect(scheduleUpload.mock.calls).toEqual([
|
||||
[[entryPhoto], 1],
|
||||
[[galleryPhoto], 1],
|
||||
[[entryPhoto], 1, null],
|
||||
[[galleryPhoto], 1, null],
|
||||
]);
|
||||
scheduleUpload.mockClear();
|
||||
const fields = { taken_at: '2026-05-30T13:52:19.000Z', lat: '64.1466000', lng: '-21.9426000' };
|
||||
const hint = { takenAt: '2026-05-30T13:52:19.000Z', lat: 64.1466, lng: -21.9426 };
|
||||
await c.uploadGalleryPhotos(user, '9', [{ filename: 'g.jpg' } as Express.Multer.File], fields);
|
||||
await c.uploadEntryPhotos(user, '3', [{ filename: 'a.jpg', originalname: 'a.jpg' } as Express.Multer.File], fields);
|
||||
// Two files in one request: the hint names neither of them.
|
||||
const two = [{ filename: 'g.jpg' }, { filename: 'h.jpg' }] as Express.Multer.File[];
|
||||
await c.uploadGalleryPhotos(user, '9', two, fields);
|
||||
expect(scheduleUpload.mock.calls.map((call) => call[2])).toEqual([hint, hint, null]);
|
||||
});
|
||||
|
||||
it('link-photo: 400 without id (accepts legacy photo_id), 403, success, and the asking tab is skipped', async () => {
|
||||
|
||||
Reference in New Issue
Block a user