This commit is contained in:
@@ -2,6 +2,8 @@ import { describe, it, expect } from 'vitest'
|
||||
import { mountSuspended, registerEndpoint } from '@nuxt/test-utils/runtime'
|
||||
import Index from '../../app/pages/index.vue'
|
||||
|
||||
const wait = (ms = 150) => new Promise(r => setTimeout(r, ms))
|
||||
|
||||
describe('index page', () => {
|
||||
it('renders map and uses cameras', async () => {
|
||||
registerEndpoint('/api/cameras', () => ({
|
||||
@@ -11,7 +13,7 @@ describe('index page', () => {
|
||||
registerEndpoint('/api/pois', () => [])
|
||||
registerEndpoint('/api/me', () => null, { method: 'GET' })
|
||||
const wrapper = await mountSuspended(Index)
|
||||
await new Promise(r => setTimeout(r, 150))
|
||||
await wait()
|
||||
expect(wrapper.findComponent({ name: 'KestrelMap' }).exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user