Release branch for 4.0.0.
This commit is contained in:
jubnl
2026-08-27 13:22:39 +02:00
committed by GitHub
parent e60427f813
commit 77dddd5e8a
3355 changed files with 403744 additions and 67215 deletions
@@ -14,16 +14,16 @@ const { pluginsEnabled } = vi.hoisted(() => ({
vi.mock('../../../src/db/database', () => ({ db: { prepare: () => ({ get: () => undefined }) }, canAccessTrip: vi.fn() }));
vi.mock('../../../src/nest/plugins/kill-switch', () => ({ pluginsEnabled }));
import { AtlasLayersController } from '../../../src/nest/plugins/atlas-layers.controller';
import type { PluginRuntimeService } from '../../../src/nest/plugins/plugin-runtime.service';
import { AtlasLayersController } from '../../../src/nest/plugins/contributions/atlas-layers.controller';
import type { PluginHooks } from '../../../src/nest/plugins/plugin-hooks.service';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const req = (id?: number) => ({ user: id === undefined ? undefined : { id } }) as any;
function controller(invoke: (id: string) => unknown, providers = ['p1']) {
const runtime = {
providersOf: vi.fn(() => providers),
invokeHook: vi.fn(async (id: string) => invoke(id)),
} as unknown as PluginRuntimeService;
atlasLayers: vi.fn(async (id: string) => invoke(id)),
} as unknown as PluginHooks;
return { c: new AtlasLayersController(runtime), runtime };
}
const layer = (over: Record<string, unknown> = {}) => ({ id: 'l1', countries: [{ code: 'FR' }], ...over });
@@ -53,7 +53,7 @@ describe('AtlasLayersController', () => {
countries: [{ code: 'FR', tone: 'success', label: 'Paris trip' }],
}]);
// user-scoped: empty args, the acting user is bound host-side
expect(runtime.invokeHook).toHaveBeenCalledWith('p1', 'atlasLayerProvider', 'getLayers', [], 5, 5000);
expect(runtime.atlasLayers).toHaveBeenCalledWith('p1', 5);
});
it('uppercase-coerces codes, drops anything that is not ISO alpha-2, defaults a bad tone', async () => {