feat: Add CSAT reports (#2608)
This commit is contained in:
parent
b7806fc210
commit
cb44eb2964
34 changed files with 1120 additions and 57 deletions
29
app/javascript/dashboard/api/specs/csatReports.spec.js
Normal file
29
app/javascript/dashboard/api/specs/csatReports.spec.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import csatReportsAPI from '../csatReports';
|
||||
import ApiClient from '../ApiClient';
|
||||
import describeWithAPIMock from './apiSpecHelper';
|
||||
|
||||
describe('#Reports API', () => {
|
||||
it('creates correct instance', () => {
|
||||
expect(csatReportsAPI).toBeInstanceOf(ApiClient);
|
||||
expect(csatReportsAPI.apiVersion).toBe('/api/v1');
|
||||
expect(csatReportsAPI).toHaveProperty('get');
|
||||
expect(csatReportsAPI).toHaveProperty('getMetrics');
|
||||
});
|
||||
describeWithAPIMock('API calls', context => {
|
||||
it('#get', () => {
|
||||
csatReportsAPI.get({ page: 1 });
|
||||
expect(context.axiosMock.get).toHaveBeenCalledWith(
|
||||
'/api/v1/csat_survey_responses',
|
||||
{
|
||||
params: { page: 1 },
|
||||
}
|
||||
);
|
||||
});
|
||||
it('#getMetrics', () => {
|
||||
csatReportsAPI.getMetrics();
|
||||
expect(context.axiosMock.get).toHaveBeenCalledWith(
|
||||
'/api/v1/csat_survey_responses/metrics'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue