update
This commit is contained in:
@@ -12,6 +12,10 @@ class Agents extends ApiClient {
|
||||
emails,
|
||||
});
|
||||
}
|
||||
|
||||
resetPassword(agentId) {
|
||||
return axios.post(`${this.url}/${agentId}/reset_password`);
|
||||
}
|
||||
}
|
||||
|
||||
export default new Agents();
|
||||
|
||||
@@ -9,6 +9,7 @@ describe('#AgentAPI', () => {
|
||||
expect(agents).toHaveProperty('create');
|
||||
expect(agents).toHaveProperty('update');
|
||||
expect(agents).toHaveProperty('delete');
|
||||
expect(agents).toHaveProperty('resetPassword');
|
||||
});
|
||||
|
||||
describe('API calls', () => {
|
||||
@@ -34,5 +35,12 @@ describe('#AgentAPI', () => {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('#resetPassword', () => {
|
||||
agents.resetPassword(42);
|
||||
expect(axiosMock.post).toHaveBeenCalledWith(
|
||||
'/api/v1/agents/42/reset_password'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user