fleet/frontend/pages/admin/IntegrationsPage/IntegrationPage.tests.tsx
Gabriel Hernandez 37ac5db5e8
implement UI for automatic enrollment section in integrations (#11642)
relates to #10745

Implements the UI for automatic enrollment. This includes:

**moving ABM section into this page**


![image](https://github.com/fleetdm/fleet/assets/1153709/f819d90d-0a4b-4c42-9a55-f825c027577e)

**implementing end user authentication**


![image](https://github.com/fleetdm/fleet/assets/1153709/7a326606-5964-4004-a0c9-ac16f65cebdc)

**implement uploading EULA pdf**


![image](https://github.com/fleetdm/fleet/assets/1153709/22710262-e9a3-4992-ab49-287ea53bf878)


![image](https://github.com/fleetdm/fleet/assets/1153709/ff83de9e-8066-4179-a648-58f75516601d)

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
2023-05-17 11:18:31 +01:00

37 lines
948 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 section in the side nav if MDM feature is enabled", () => {
const render = createCustomRenderer({
withBackendMock: true,
context: {
app: { isMdmEnabledAndConfigured: true },
},
});
render(
<IntegrationsPage router={mockRouter} params={{ section: "mdm" }} />
);
expect(
screen.getByText("Mobile device management (MDM)")
).toBeInTheDocument();
});
});