1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-27 02:35:50 +03:00
leon/test/unit/server/helpers/loader.spec.js

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()
})
})
})