cfdf4a12c8
* complete dshboard api specs * code cleanup * add conversation mixin spec * add isadmin mixin spec * add agent details component spec * add notification badge spec * spec for thumbnail exist in agent details * fix the deprecation warnings * add agent details spec * add account selector specs * code cleanup * refactor contact spec * review fixes * review fixes * add shared spec helper * update api spec helper * review fixes
31 lines
1 KiB
JavaScript
31 lines
1 KiB
JavaScript
import inboxesAPI from '../inboxes';
|
|
import ApiClient from '../ApiClient';
|
|
import describeWithAPIMock from './apiSpecHelper';
|
|
|
|
describe('#InboxesAPI', () => {
|
|
it('creates correct instance', () => {
|
|
expect(inboxesAPI).toBeInstanceOf(ApiClient);
|
|
expect(inboxesAPI).toHaveProperty('get');
|
|
expect(inboxesAPI).toHaveProperty('show');
|
|
expect(inboxesAPI).toHaveProperty('create');
|
|
expect(inboxesAPI).toHaveProperty('update');
|
|
expect(inboxesAPI).toHaveProperty('delete');
|
|
expect(inboxesAPI).toHaveProperty('getAssignableAgents');
|
|
expect(inboxesAPI).toHaveProperty('getCampaigns');
|
|
});
|
|
describeWithAPIMock('API calls', context => {
|
|
it('#getAssignableAgents', () => {
|
|
inboxesAPI.getAssignableAgents(1);
|
|
expect(context.axiosMock.get).toHaveBeenCalledWith(
|
|
'/api/v1/inboxes/1/assignable_agents'
|
|
);
|
|
});
|
|
|
|
it('#getCampaigns', () => {
|
|
inboxesAPI.getCampaigns(2);
|
|
expect(context.axiosMock.get).toHaveBeenCalledWith(
|
|
'/api/v1/inboxes/2/campaigns'
|
|
);
|
|
});
|
|
});
|
|
});
|