Bug: Fix error message when existing agent email is reused for a new agent (#538)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
ghosteathuman
2020-02-22 21:36:16 +08:00
committed by GitHub
parent 6340eb3ae2
commit 67f4f69e8a
4 changed files with 10 additions and 3 deletions

View File

@@ -40,7 +40,9 @@ describe('#actions', () => {
});
it('sends correct actions if API is error', async () => {
axios.post.mockRejectedValue({ message: 'Incorrect header' });
await expect(actions.create({ commit })).rejects.toThrow(Error);
await expect(actions.create({ commit })).rejects.toEqual({
message: 'Incorrect header',
});
expect(commit.mock.calls).toEqual([
[types.default.SET_AGENT_CREATING_STATUS, true],
[types.default.SET_AGENT_CREATING_STATUS, false],