Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed Dec 30, 2024
1 parent d92d169 commit 160f285
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/EmptyChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const onEngine = (engine: string) => {
const animateEngineLogo = (srcSelector: string, dstSelector: string, callback: (progress: number) => void) => {
try {
const container = document.querySelector('.engines')
const source = document.querySelector(srcSelector)
const target = document.querySelector(dstSelector)
Expand All @@ -134,6 +136,10 @@ const animateEngineLogo = (srcSelector: string, dstSelector: string, callback: (
const targetY = target.getBoundingClientRect().top
moveElement(clone, targetX, targetY, 150, (progress) => callback({ container, source, target, clone }, progress))
} catch (e) {
console.error(e)
}
}
const moveElement = (element: HTMLElement, endX: number, endY: number, duration: number, callback: (progress: number) => void) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/components/empty_chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test('Renders correctly', async () => {

test('Renders engines and models', async () => {
const wrapper: VueWrapper<any> = mount(EmptyChat)
expect(wrapper.findAllComponents(EngineLogo).length).toBe(availableEngines.length)
expect(wrapper.findAllComponents(EngineLogo).length).toBe(availableEngines.length+1)
expect(wrapper.findAll('.empty select option')).toHaveLength(3)
})

Expand Down

0 comments on commit 160f285

Please sign in to comment.