1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-18 14:21:32 +03:00
leon/test/unit/server/helpers/loader.spec.js
2021-12-27 18:37:42 +08:00

22 lines
449 B
JavaScript

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