1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-21 15:51:49 +03:00
leon/test/unit/server/helpers/loader.spec.js
2019-05-21 14:41:22 +08:00

22 lines
433 B
JavaScript

'use strict'
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()
})
})
})