Feature: As an end-user, I should be able to see the list of agents in the widget. (#461)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
33e0bd434b
commit
83b0bb4062
@@ -0,0 +1,28 @@
|
||||
import { mutations } from '../../agent';
|
||||
import agents from './data';
|
||||
|
||||
describe('#mutations', () => {
|
||||
describe('#setAgents', () => {
|
||||
it('set agent records', () => {
|
||||
const state = { records: [] };
|
||||
mutations.setAgents(state, agents);
|
||||
expect(state.records).toEqual(agents);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setError', () => {
|
||||
it('set error flag', () => {
|
||||
const state = { records: [], uiFlags: {} };
|
||||
mutations.setError(state, true);
|
||||
expect(state.uiFlags.isError).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setError', () => {
|
||||
it('set fetched flag', () => {
|
||||
const state = { records: [], uiFlags: {} };
|
||||
mutations.setHasFetched(state, true);
|
||||
expect(state.uiFlags.hasFetched).toEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user