mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
For [#28629](https://github.com/fleetdm/fleet/issues/28629) this disabled the manual agent install checkbox if the user has already uploaded install software or a run script for setup experience - [x] Added/updated automated tests - [x] Manual QA for all new/changed functionality
19 lines
691 B
TypeScript
19 lines
691 B
TypeScript
import { http, HttpResponse } from "msw";
|
|
|
|
import { baseUrl } from "test/test-utils";
|
|
import { createMockLabel } from "__mocks__/labelsMock";
|
|
import { createMockHostsResponse } from "__mocks__/hostMock";
|
|
import { ILabel } from "interfaces/label";
|
|
import { IHost } from "interfaces/host";
|
|
|
|
export const getLabelHandler = (overrides: Partial<ILabel>) =>
|
|
http.get(baseUrl("/labels/:id"), () => {
|
|
return HttpResponse.json({
|
|
label: createMockLabel({ ...overrides }),
|
|
});
|
|
});
|
|
|
|
export const getLabelHostsHandler = (mockHosts: Partial<IHost>[] | undefined) =>
|
|
http.get(baseUrl("/labels/:id/hosts"), () => {
|
|
return HttpResponse.json(createMockHostsResponse(mockHosts));
|
|
});
|