fleet/frontend/pages/admin/IntegrationsPage/IntegrationPage.tests.tsx
Gabriel Hernandez 5d20ee85fc
UI for wiping a host (#16874)
# Checklist for submitter

add ability in the UI to wipe a host managed by the fleet mdm. This
includes:

**new wipe host action dropdown option:**


![image](https://github.com/fleetdm/fleet/assets/1153709/a5c01e45-d494-4762-8504-1e1963093809)

**new wipe modal to initiate wiping a host:**


![image](https://github.com/fleetdm/fleet/assets/1153709/829c8dfb-a60f-427b-b6b8-2804924c0b71)

**wipe and wiping host status tags: **


![image](https://github.com/fleetdm/fleet/assets/1153709/de947160-7273-409d-bcfd-c219e887bb9d)


![image](https://github.com/fleetdm/fleet/assets/1153709/2a13e79a-2bcd-4aa5-b15f-5bb57348d191)

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
2024-02-26 14:26:30 +00:00

37 lines
946 B
TypeScript

import React from "react";
import { screen } from "@testing-library/react";
import { createCustomRenderer } from "test/test-utils";
import IntegrationsPage from "./IntegrationsPage";
// TODO: figure out how to mock the router properly.
const mockRouter = {
push: jest.fn(),
replace: jest.fn(),
goBack: jest.fn(),
goForward: jest.fn(),
go: jest.fn(),
setRouteLeaveHook: jest.fn(),
isActive: jest.fn(),
createHref: jest.fn(),
createPath: jest.fn(),
};
describe("Integrations Page", () => {
it("renders the MDM sidenav and content if MDM feature is enabled", () => {
const render = createCustomRenderer({
withBackendMock: true,
context: {
app: { isMacMdmEnabledAndConfigured: true },
},
});
render(
<IntegrationsPage router={mockRouter} params={{ section: "mdm" }} />
);
expect(screen.getAllByText("Mobile device management (MDM)")).toHaveLength(
2
);
});
});