mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-18 14:21:32 +03:00
22 lines
449 B
JavaScript
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()
|
|
})
|
|
})
|
|
})
|