fleet/frontend/kolide/entities/status_labels.tests.js
Mike Stone d747a471af Refactor API client (#1335)
* Isolate each API entity
* Improve code structure in API client and request mocks
* Standardize on a request mock structure
* Use helper for creating request mocks
* Adds Request class to handle API requests
2017-03-02 17:07:01 -05:00

29 lines
719 B
JavaScript

import expect from 'expect';
import nock from 'nock';
import Kolide from 'kolide';
import mocks from 'test/mocks';
const { statusLabels: statusLabelMocks } = mocks;
describe('Kolide - API client (status labels)', () => {
afterEach(() => {
nock.cleanAll();
Kolide.setBearerToken(null);
});
const bearerToken = 'valid-bearer-token';
describe('#getCounts', () => {
it('calls the appropriate endpoint with the correct parameters', () => {
const request = statusLabelMocks.getCounts.valid(bearerToken);
Kolide.setBearerToken(bearerToken);
return Kolide.statusLabels.getCounts()
.then(() => {
expect(request.isDone()).toEqual(true);
});
});
});
});