feat: Render contact custom attributes in contact/conversation sidebar (#3310)

This commit is contained in:
Muhsin Keloth
2021-11-11 15:23:33 +05:30
committed by GitHub
parent e12edb51a2
commit 76370267f3
33 changed files with 416 additions and 124 deletions

View File

@@ -206,4 +206,24 @@ describe('#actions', () => {
]);
});
});
describe('#deleteCustomAttributes', () => {
it('sends correct mutations if API is success', async () => {
axios.post.mockResolvedValue({ data: { payload: contactList[0] } });
await actions.deleteCustomAttributes(
{ commit },
{ id: 1, customAttributes: ['cloud-customer'] }
);
expect(commit.mock.calls).toEqual([[types.EDIT_CONTACT, contactList[0]]]);
});
it('sends correct actions if API is error', async () => {
axios.patch.mockRejectedValue({ message: 'Incorrect header' });
await expect(
actions.deleteCustomAttributes(
{ commit },
{ id: 1, customAttributes: ['cloud-customer'] }
)
).rejects.toThrow(Error);
});
});
});