mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
7a7fb9eac9
* 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
22 lines
418 B
JavaScript
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);
|
|
};
|