Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed Nov 1, 2024
1 parent fc58bdf commit b93f949
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/unit/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ const chats = [
engine: 'engine',
model: 'model',
messages: [
{ uuid: 1, role: 'system', content: 'Hi' },
{ uuid: 2, role: 'user', content: 'Hello' }
new Message('system', 'Hi'),
new Message('user', 'Hello')
]
})
]

// to make testing easier
// was trying to use expect.any(String) but it was not working
chats[1].messages[0].uuid = '1'
chats[1].messages[0].createdAt = 0
chats[1].messages[1].uuid = '2'
chats[1].messages[1].createdAt = 0


window.api = {
config: {
load: vi.fn(() => JSON.parse(JSON.stringify(defaultSettings))),
Expand Down Expand Up @@ -103,8 +111,8 @@ test('Save history', async () => {
model: 'model',
deleted: false,
messages: [
{ uuid: 1, role: 'system', type: 'text', content: 'Hi', toolCall: null, attachment: null, transient: false },
{ uuid: 2, role: 'user', type: 'text', content: 'Hello', toolCall: null, attachment: null, transient: false }
{ uuid: '1', createdAt: 0, role: 'system', type: 'text', content: 'Hi', toolCall: null, attachment: null, transient: false },
{ uuid: '2', createdAt: 0, role: 'user', type: 'text', content: 'Hello', toolCall: null, attachment: null, transient: false }
]
}])
})
Expand Down

0 comments on commit b93f949

Please sign in to comment.