Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(mcp): follow the mail tools and file tools that left their addon gates

Mauricef6d52727f7d1
diff --git a/server/src/addons.ts b/server/src/addons.ts
index c4c45da04..23a53713b 100644
--- a/server/src/addons.ts
+++ b/server/src/addons.ts
@@ -44,7 +44,6 @@ export const MCP_GATED_ADDON_IDS: readonly AddonId[] = [
ADDON_IDS.COLLAB,
ADDON_IDS.COLLECTIONS,
ADDON_IDS.DAWARICH,
- ADDON_IDS.DOCUMENTS,
ADDON_IDS.JOURNEY,
ADDON_IDS.PACKING,
ADDON_IDS.ROADTRIP,
diff --git a/server/tests/unit/mcp/demo-tool-gate.test.ts b/server/tests/unit/mcp/demo-tool-gate.test.ts
index 70f96ee21..fe1bf309e 100644
--- a/server/tests/unit/mcp/demo-tool-gate.test.ts
+++ b/server/tests/unit/mcp/demo-tool-gate.test.ts
@@ -74,6 +74,8 @@ beforeEach(async () => {
await Promise.all(Object.values(ADDON_IDS).map((id) => setAddonEnabled(orm, id, true)));
// The wanderer tools show only while wanderer is allowed under Tours.
await setAppSetting(orm, 'tours_wanderer_enabled', 'true');
+ // The mail import tools show only while the import is on.
+ await setAppSetting(orm, 'mail_ingest_enabled', 'true');
});
afterEach(() => {
diff --git a/server/tests/unit/nest/admin.service.test.ts b/server/tests/unit/nest/admin.service.test.ts
index fa7993cb9..502d757db 100644
--- a/server/tests/unit/nest/admin.service.test.ts
+++ b/server/tests/unit/nest/admin.service.test.ts
@@ -750,9 +750,8 @@ describe('updateAddon', () => {
if (!flip.error) expect(flip.mcpAffected).toBe(false);
}
- // and the one this change put on the list carries the opposite verdict
- const docsFlip = (await updateAddon('documents', { enabled: false })) as any;
- if (!docsFlip.error) expect(docsFlip.mcpAffected).toBe(true);
+ // documents left the list once its file tools stayed on without it
+ expect(((await updateAddon('documents', { enabled: false })) as any).mcpAffected).toBe(false);
});
it('ADMIN-SVC-087 — refuses to enable a photo provider while journey is off', async () => {
diff --git a/server/tests/unit/nest/photo-provider.test.ts b/server/tests/unit/nest/photo-provider.test.ts
index 4c1e47893..833882e54 100644
--- a/server/tests/unit/nest/photo-provider.test.ts
+++ b/server/tests/unit/nest/photo-provider.test.ts
@@ -87,6 +87,7 @@ describe('ImmichPhotoProvider', () => {
expect(immich.streamImmichAsset).toHaveBeenCalledWith(res, 7, 'asset-1', 'original', 42, {
mediaType: 'image',
range: 'bytes=0-99',
+ publicView: false,
});
await immichProvider.fetchThumbnailBytes(ref);