fleet/frontend/test/mocks/target_mocks.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

47 lines
1.1 KiB
JavaScript

import createRequestMock from 'test/mocks/create_request_mock';
export default {
loadAll: {
valid: (bearerToken, query) => {
return createRequestMock({
bearerToken,
endpoint: '/api/v1/kolide/targets',
method: 'post',
params: {
query,
selected: {
hosts: [],
labels: [],
},
},
response: {
targets_count: 1234,
targets: [
{
id: 3,
label: 'OS X El Capitan 10.11',
name: 'osx-10.11',
platform: 'darwin',
target_type: 'hosts',
},
{
id: 4,
label: 'Jason Meller\'s Macbook Pro',
name: 'jmeller.local',
platform: 'darwin',
target_type: 'hosts',
},
{
id: 4,
label: 'All Macs',
name: 'macs',
count: 1234,
target_type: 'labels',
},
],
},
});
},
},
};