fix: Update the relevant agent presence only (#5220)
This commit is contained in:
@@ -96,13 +96,21 @@ describe('#actions', () => {
|
||||
});
|
||||
|
||||
describe('#updatePresence', () => {
|
||||
it('sends correct actions if API is success', async () => {
|
||||
it('sends correct actions', async () => {
|
||||
const data = { users: { 1: 'online' }, contacts: { 2: 'online' } };
|
||||
actions.updatePresence({ commit, dispatch }, data);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_AGENT_UPDATING_STATUS, true],
|
||||
[types.default.UPDATE_AGENTS_PRESENCE, data],
|
||||
[types.default.SET_AGENT_UPDATING_STATUS, false],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#updateSingleAgentPresence', () => {
|
||||
it('sends correct actions', async () => {
|
||||
const data = { id: 1, availabilityStatus: 'online' };
|
||||
actions.updateSingleAgentPresence({ commit, dispatch }, data);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.UPDATE_SINGLE_AGENT_PRESENCE, data],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user