fleet/frontend/test/handlers/label-handlers.ts
Gabriel Hernandez 50af9e800e
disabled manual agent install checkbox when setup experience software and run script is already added (#28679)
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
2025-04-30 16:22:24 +01:00

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));
});