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.

fix(mcp): hold two more tests to the fixed Costs keys

Maurice9eab19ea6ca9
diff --git a/server/tests/unit/mcp/tools-prompts.test.ts b/server/tests/unit/mcp/tools-prompts.test.ts
index 618f1216e..4f28f561a 100644
--- a/server/tests/unit/mcp/tools-prompts.test.ts
+++ b/server/tests/unit/mcp/tools-prompts.test.ts
@@ -565,10 +565,10 @@ describe('Prompt: budget-overview', () => {
const client = await buildServer(user.id);
const text = await invokePromptText(client, 'budget-overview', { tripId: trip.id });
expect(text).toContain('Budget Trip');
- expect(text).toContain('Transport');
- expect(text).toContain('Accommodation');
- expect(text).toContain('550'); // Transport total
- expect(text).toContain('300'); // Accommodation total
+ // Totals group by the fixed Costs key, whatever case the expense was stored in (#2835).
+ expect(text).toContain('- transport: 250');
+ expect(text).toContain('- accommodation: 300');
+ expect(text).toContain('550');
});
it('prints a foreign-currency bill at the rate it was booked at, not as that many euros (#2525)', async () => {
diff --git a/server/tests/unit/mcp/tools-transports.test.ts b/server/tests/unit/mcp/tools-transports.test.ts
index 5e7ffd953..2a8e4506e 100644
--- a/server/tests/unit/mcp/tools-transports.test.ts
+++ b/server/tests/unit/mcp/tools-transports.test.ts
@@ -349,7 +349,8 @@ describe('Transport tools: the price link', () => {
const data = parseToolResult(result) as { reservation: { id: number } };
const item = await findRow(orm, BudgetItems, { reservation: data.reservation.id });
- expect(item).toMatchObject({ name: 'ZRH → CDG', category: 'Flights', total_price: 240 });
+ // Stored as its fixed Costs key (#2835).
+ expect(item).toMatchObject({ name: 'ZRH → CDG', category: 'flights', total_price: 240 });
// The price also rides along in the reservation metadata, as the REST path does.
expect(broadcastMock.mock.calls.some((c) => c[1] === 'budget:created')).toBe(true);
});