chore: Move agent availability to Account level (#3074)
- Move agent availability to the account level
This commit is contained in:
parent
1c6a539c0a
commit
c54aae21ff
84 changed files with 618 additions and 148 deletions
|
@ -54,13 +54,16 @@ describe('#actions', () => {
|
|||
|
||||
describe('#updateAvailability', () => {
|
||||
it('sends correct actions if API is success', async () => {
|
||||
axios.put.mockResolvedValue({
|
||||
data: { id: 1, name: 'John', availability_status: 'offline' },
|
||||
axios.post.mockResolvedValue({
|
||||
data: {
|
||||
id: 1,
|
||||
account_users: [{ account_id: 1, availability_status: 'offline' }],
|
||||
},
|
||||
headers: { expiry: 581842904 },
|
||||
});
|
||||
await actions.updateAvailability(
|
||||
{ commit, dispatch },
|
||||
{ availability: 'offline' }
|
||||
{ availability: 'offline', account_id: 1 },
|
||||
);
|
||||
expect(setUser).toHaveBeenCalledTimes(1);
|
||||
expect(commit.mock.calls).toEqual([[types.default.SET_CURRENT_USER]]);
|
||||
|
|
|
@ -21,7 +21,11 @@ describe('#getters', () => {
|
|||
it('get', () => {
|
||||
expect(
|
||||
getters.getCurrentUserAvailabilityStatus({
|
||||
currentUser: { id: 1, name: 'Pranav', availability_status: 'busy' },
|
||||
currentAccountId: 1,
|
||||
currentUser: {
|
||||
id: 1,
|
||||
accounts: [{ id: 1, availability_status: 'busy' }],
|
||||
},
|
||||
})
|
||||
).toEqual('busy');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue