Create util for apiLoadingStatus (#170)
* Create util for apiLoadingStatus
* Revert "Fix #52 rubocop metrics abc size in passwords controller (#119)"
This reverts commit 9c22da0ac6
.
This commit is contained in:
parent
cd43b09574
commit
e0d291c49e
5 changed files with 32 additions and 18 deletions
15
app/javascript/dashboard/store/utils/specs/api.spec.js
Normal file
15
app/javascript/dashboard/store/utils/specs/api.spec.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue