Chatwoot/app/javascript/dashboard/store/utils/specs/api.spec.js

16 lines
447 B
JavaScript
Raw Normal View History

import { getLoadingStatus, setLoadingStatus } from '../api';
describe('#getLoadingStatus', () => {
it('returns correct status', () => {
expect(getLoadingStatus({ fetchAPIloadingStatus: true })).toBe(true);
});
});
describe('#setLoadingStatus', () => {
it('set correct status', () => {
const state = { fetchAPIloadingStatus: true };
setLoadingStatus(state, false);
expect(state.fetchAPIloadingStatus).toBe(false);
});
});