fleet/frontend/test/target_mock.js
Mike Stone 7a7fb9eac9 Select targets tests (#1307)
* Adds tests for the TargetDetails component

* Adds tests for Select Targets Menu

* Rename target_stub to target_mock

* Adds tests for the SelectTargetsDropdown & minor refactor
2017-03-03 10:05:03 -05:00

22 lines
418 B
JavaScript

import nock from 'nock';
const defaultParams = {
selected: {
hosts: [],
labels: [],
},
};
const defaultResponse = {
targets: {
hosts: [],
labels: [],
},
};
export default (params = defaultParams, response = defaultResponse, responseStatus = 200) => {
return nock('http://localhost:8080')
.post('/api/v1/kolide/targets', JSON.stringify(params))
.reply(responseStatus, response);
};