test: follow the qol sweep in the e2e schemas and the assertions it changed

The hand-written e2e schemas gain the new columns and place_regions, and the
unit assertions take the new arguments and fields. The Public API page names
GET /api/auth/app-config for the running version.
This commit is contained in:
Maurice
2026-09-30 23:28:14 +02:00
parent 8fd46c4c18
commit f5103d04e0
19 changed files with 56 additions and 223 deletions
@@ -298,7 +298,7 @@ describe('Tool: clear_day_assignments (#2470)', () => {
expect(data.success).toBe(true);
expect([...data.removedIds].sort()).toEqual([a1.id, a2.id].sort());
expect(testDb.prepare('SELECT COUNT(*) AS n FROM day_assignments WHERE day_id = ?').get(day.id)).toEqual({ n: 0 });
expect(broadcastMock).toHaveBeenCalledWith(trip.id, 'assignment:deleted', { assignmentId: a1.id, dayId: day.id });
expect(broadcastMock).toHaveBeenCalledWith(trip.id, 'assignment:deleted', expect.objectContaining({ assignmentId: a1.id, dayId: day.id }));
});
});
@@ -1223,9 +1223,9 @@ describe('applySettlementUpdate', () => {
const res = budget.applySettlementUpdate(7, 1, { from_user_id: 2, to_user_id: 1, amount: 10.126 });
// from, to, rounded amount, currency-flag(0)/value(null), rate-flag(null)/value(1),
// settled_at-flag(0)/value(null), id.
// No currency/exchange_rate/settled_at passed → all three CASE guards keep the existing columns.
expect(run).toHaveBeenCalledWith(2, 1, 10.13, 0, null, null, 1, 0, null, 7);
// settled_at-flag(0)/value(null), note-flag(0)/value(null) (#2340), id.
// No currency/exchange_rate/settled_at/note passed → every CASE guard keeps the existing column.
expect(run).toHaveBeenCalledWith(2, 1, 10.13, 0, null, null, 1, 0, null, 0, null, 7);
expect(res).toMatchObject({ id: 7, from_user_id: 2, to_user_id: 1, amount: 10.13 });
});
});
+4 -3
View File
@@ -932,14 +932,15 @@ describe('MapsService: Amap first inside China when picked outright (#1636)', ()
mockProviderGet.mockReturnValue({ value: 'amap' });
keys({ amap: 'akey' });
osmAnswers([]);
const fetchSpy = vi.fn().mockResolvedValue(ok({ count: '0', pois: [] }));
vi.stubGlobal('fetch', fetchSpy);
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(ok({ count: '0', pois: [] })));
const searchText = vi.spyOn(AmapPlacesProvider.prototype, 'searchText');
spies.push(searchText);
const result = await svc.searchPlaces(1, 'nothing here', 'zh', BEIJING);
expect(result).toEqual({ places: [], source: 'amap' });
expect(trekPlacesSearch).toHaveBeenCalled();
expect(fetchSpy).toHaveBeenCalledTimes(1);
expect(searchText).toHaveBeenCalledTimes(1);
});
it('AMAP-097: a search centred outside China keeps the usual order, so the Eiffel Tower does not land in Macau', async () => {
+1 -1
View File
@@ -1514,7 +1514,7 @@ describe('getSharedCalendars', () => {
const calendars = svc.getSharedCalendars(viewer.id, '2025');
expect(calendars[0].companyHolidays).toEqual([{ date: '2025-12-24' }]);
expect(calendars[0].companyHolidays).toEqual([{ date: '2025-12-24', fraction: 1 }]);
});
it('VACAY-SVC-065: an owner without any plan yields empty arrays (no lazy creation)', () => {
@@ -236,7 +236,7 @@ describe('addon-gated domains validate their input', () => {
const toggleCompanyHoliday = vi.fn(() => ({}));
const host = build({ vacay: { toggleCompanyHoliday } });
await host.dispatch(req('vacay.toggleCompanyHoliday', { date: '2027-01-01' }), 42);
expect(toggleCompanyHoliday).toHaveBeenCalledWith(1, '2027-01-01', undefined, undefined);
expect(toggleCompanyHoliday).toHaveBeenCalledWith(1, '2027-01-01', undefined, undefined, undefined);
});
it('ADDONERR-010e a collab message without a replyTo passes null', async () => {
@@ -285,7 +285,7 @@ describe('every schema-validated method rejects a payload its schema refuses', (
createTestPluginRegistry([new VacayRpc(vacay, guards), new TagsRpc(tags)]),
);
await host.dispatch(req('vacay.toggleCompanyHoliday', { date: '2027-01-01', note: 42 }), 42);
expect(toggleCompanyHoliday).toHaveBeenCalledWith(1, '2027-01-01', undefined, undefined);
expect(toggleCompanyHoliday).toHaveBeenCalledWith(1, '2027-01-01', undefined, undefined, undefined);
await host.dispatch(req('tags.update', { tagId: 1, input: { name: 'kept' } }), 42);
expect(update).toHaveBeenCalledWith(1, 'kept', undefined);
});