feat(trips): support custom tags and MCP tag management

This commit is contained in:
Maurice
2026-12-05 01:34:47 +01:00
parent 908e4e1f8b
commit c32c17ca17
11 changed files with 151 additions and 29 deletions
+16
View File
@@ -298,6 +298,22 @@ describe('Tool: update_trip', () => {
});
});
it('updates dashboard tags by name while preserving unrelated tags', async () => {
const { user } = await makeUser(orm);
const trip = await makeTrip(orm, user.id, { title: 'Weekend' });
await withHarness(user.id, async (h) => {
await h.client.callTool({ name: 'update_trip', arguments: { tripId: trip.id, tags: ['Work', 'Family'] } });
const result = await h.client.callTool({
name: 'update_trip',
arguments: { tripId: trip.id, remove_tags: ['work'], add_tags: [' FAMILY ', 'City break'] },
});
expect(parseToolResult(result)).toMatchObject({ trip: { title: 'Weekend', tags: ['Family', 'City break'] } });
expect(broadcastMock).toHaveBeenCalledWith(trip.id, 'trip:updated', expect.objectContaining({
trip: expect.objectContaining({ tags: ['Family', 'City break'] }),
}));
});
});
it('broadcasts trip:updated event', async () => {
const { user } = await makeUser(orm);
const trip = await makeTrip(orm, user.id);