Chatwoot/app/javascript/dashboard/store/utils/specs/api.spec.js
Pranav Raj S e0d291c49e
Create util for apiLoadingStatus (#170)
* Create util for apiLoadingStatus

* Revert "Fix #52 rubocop metrics abc size in passwords controller (#119)"

This reverts commit 9c22da0ac6.
2019-10-22 13:28:45 +05:30

15 lines
447 B
JavaScript

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