mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
7104d0312e
- Fix ability to run live query against teams - Update unit tests to support live queries against teams
29 lines
482 B
JavaScript
29 lines
482 B
JavaScript
import nock from "nock";
|
|
|
|
const defaultParams = {
|
|
query: "",
|
|
query_id: 1,
|
|
selected: {
|
|
hosts: [],
|
|
labels: [],
|
|
teams: [],
|
|
},
|
|
};
|
|
const defaultResponse = {
|
|
targets: {
|
|
hosts: [],
|
|
labels: [],
|
|
teams: [],
|
|
},
|
|
};
|
|
|
|
export default (
|
|
params = defaultParams,
|
|
response = defaultResponse,
|
|
responseStatus = 200
|
|
) => {
|
|
return nock("http://localhost:8080")
|
|
.post("/api/v1/fleet/targets", JSON.stringify(params))
|
|
.reply(responseStatus, response);
|
|
};
|