make kestrel a tak server, so that it can send and receive pois as cots data
Some checks failed
ci/woodpecker/pr/pr Pipeline failed
Some checks failed
ci/woodpecker/pr/pr Pipeline failed
This commit is contained in:
@@ -37,4 +37,24 @@ describe('useLiveSessions', () => {
|
||||
expect(el.exists()).toBe(true)
|
||||
expect(JSON.parse(el.attributes('data-sessions'))).toEqual([])
|
||||
})
|
||||
|
||||
it('startPolling and stopPolling manage interval', async () => {
|
||||
registerEndpoint('/api/live', () => [])
|
||||
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'u', role: 'member' }), { method: 'GET' })
|
||||
const TestComponent = defineComponent({
|
||||
setup() {
|
||||
const { startPolling, stopPolling } = useLiveSessions()
|
||||
return () => h('div', {
|
||||
onClick: () => {
|
||||
startPolling()
|
||||
startPolling()
|
||||
stopPolling()
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
const wrapper = await mountSuspended(TestComponent)
|
||||
await wrapper.trigger('click')
|
||||
expect(wrapper.exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user