mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
fix(wanderer): offer the connection and run the watch where a trip switched Tours on
With Tours off for the instance, a trip that switched it on opened the wanderer import, but Settings hid the connection and the watch cron never ran. The addon feed now tells each user whether wanderer applies to them, and the watch looks for every user who has Tours on somewhere; the others only take their turn.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { AddonsController } from '../../../src/nest/addons/addons.controller';
|
||||
import type { AddonsService } from '../../../src/nest/addons/addons.service';
|
||||
import type { User } from '../../../src/types';
|
||||
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
|
||||
@@ -20,8 +21,8 @@ describe('AddonsController (parity with the legacy GET /api/addons route)', () =
|
||||
const list = vi.fn().mockReturnValue(feed);
|
||||
const svc = makeService({ list } as Partial<AddonsService>);
|
||||
|
||||
expect(await new AddonsController(svc).list()).toBe(feed);
|
||||
expect(await new AddonsController(svc).list({ id: 4 } as User)).toBe(feed);
|
||||
expect(list).toHaveBeenCalledTimes(1);
|
||||
expect(list).toHaveBeenCalledWith();
|
||||
expect(list).toHaveBeenCalledWith(4);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user