Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed Jan 11, 2025
1 parent e3add54 commit e9db8a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/screens/prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ test('Resets chat', async () => {
const wrapper = await prompt()
expect(wrapper.findComponent(MessageItem).text()).toBe('[{"role":"system","content":"You are an AI assistant designed to assist users by providing accurate information, answering questions, and offering helpful suggestions. Your main objectives are to understand the user\'s needs, communicate clearly, and provide responses that are informative, concise, and relevant."},{"role":"user","content":"Hello LLM"},{"role":"assistant","content":"Be kind. Don\'t mock me"}]')
wrapper.find('.clear').trigger('click')
await wrapper.vm.$nextTick()
expect(wrapper.vm.chat.messages).toHaveLength(0)
expect(wrapper.vm.chat.engine).toBe('mock')
expect(wrapper.vm.chat.model).toBe('chat')
expect(wrapper.findComponent(MessageItem).exists()).toBeFalsy()
expect(wrapper.findComponent(Prompt).vm.getPrompt()).toBe('')
emitEvent('send-prompt', { prompt: 'Bye LLM' })
await vi.waitUntil(async () => !wrapper.vm.chat.lastMessage().transient)
expect(wrapper.findComponent(MessageItem).text()).toBe('[{"role":"system","content":"You are an AI assistant designed to assist users by providing accurate information, answering questions, and offering helpful suggestions. Your main objectives are to understand the user\'s needs, communicate clearly, and provide responses that are informative, concise, and relevant."},{"role":"user","content":"Bye LLM"},{"role":"assistant","content":"Be kind. Don\'t mock me"}]')
Expand Down

0 comments on commit e9db8a2

Please sign in to comment.