mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-27 02:35:50 +03:00
22 lines
453 B
JavaScript
22 lines
453 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()
|
|
})
|
|
})
|
|
})
|