1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-22 08:11:34 +03:00
leon/test/unit/server/helpers/loader.spec.js
2021-03-03 17:09:31 +08:00

20 lines
419 B
JavaScript

import loader from '@/helpers/loader'
jest.useFakeTimers()
describe('loader helper', () => {
describe('start()', () => {
test('starts spinner', () => {
expect(loader.start()).toBeObject()
jest.runTimersToTime(60000)
expect(setInterval).toHaveBeenCalledTimes(1)
})
})
describe('stop()', () => {
test('stops spinner', () => {
expect(loader.stop()).toBeObject()
})
})
})