Skip to content

Commit d7bfe16

Browse files
committed
fix(tests): fix failing test
1 parent 54266b9 commit d7bfe16

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

apps/sim/app/api/copilot/chat/update-messages/route.test.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,35 @@ describe('Copilot Chat Update Messages API Route', () => {
327327
})
328328

329329
expect(mockSet).toHaveBeenCalledWith({
330-
messages,
330+
messages: [
331+
{
332+
id: 'msg-1',
333+
role: 'user',
334+
content: 'Hello',
335+
timestamp: '2024-01-01T10:00:00.000Z',
336+
},
337+
{
338+
id: 'msg-2',
339+
role: 'assistant',
340+
content: 'Hi there!',
341+
timestamp: '2024-01-01T10:01:00.000Z',
342+
contentBlocks: [
343+
{
344+
type: 'text',
345+
content: 'Here is the weather information',
346+
},
347+
{
348+
type: 'tool',
349+
phase: 'call',
350+
toolCall: {
351+
id: 'tool-1',
352+
name: 'get_weather',
353+
state: 'pending',
354+
},
355+
},
356+
],
357+
},
358+
],
331359
updatedAt: expect.any(Date),
332360
})
333361
})

0 commit comments

Comments
 (0)