mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
## Issue Closes #38767 ## Description - Update copy and basic test of copy - To be merged along with @mna 's BE changes for #38766 ## Screenshot of change <img width="1259" height="333" alt="Screenshot 2026-02-04 at 4 29 33 PM" src="https://github.com/user-attachments/assets/04accd98-e57d-4ec6-a050-85bb3d8a8aef" /> ## Testing - [x] QA'd all new/changed functionality manually
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import React from "react";
|
|
import { render, screen } from "@testing-library/react";
|
|
|
|
import { noop } from "lodash";
|
|
|
|
import DeleteSoftwareModal from "./DeleteSoftwareModal";
|
|
|
|
const renderModal = (
|
|
props: Partial<React.ComponentProps<typeof DeleteSoftwareModal>> = {}
|
|
) => {
|
|
return render(
|
|
<DeleteSoftwareModal
|
|
softwareId={1}
|
|
teamId={1}
|
|
onExit={noop}
|
|
onSuccess={noop}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
describe("DeleteSoftwareModal", () => {
|
|
beforeEach(() => {
|
|
jest.resetAllMocks();
|
|
});
|
|
|
|
it("renders GitOps banner when gitOpsModeEnabled is true", () => {
|
|
renderModal({ gitOpsModeEnabled: true });
|
|
|
|
expect(
|
|
screen.getByText(
|
|
"You are currently in GitOps mode. If the package is defined in GitOps, it will reappear when GitOps runs."
|
|
)
|
|
).toBeVisible();
|
|
});
|
|
|
|
it("renders default platform message when not VPP app or Android app", () => {
|
|
renderModal();
|
|
|
|
expect(screen.getByText(/won't be uninstalled/i)).toBeVisible();
|
|
expect(
|
|
screen.getByText(/Pending installs and uninstalls will be canceled\./i)
|
|
).toBeVisible();
|
|
});
|
|
|
|
it("renders App Store message when isAppStoreApp is true", () => {
|
|
renderModal({ isAppStoreApp: true });
|
|
|
|
expect(screen.getByText(/won't be uninstalled/i)).toBeVisible();
|
|
expect(
|
|
screen.getByText(
|
|
/Pending or already started installs and uninstalls won't be canceled/i
|
|
)
|
|
).toBeVisible();
|
|
});
|
|
|
|
it("renders Android message when isAndroidApp is true", () => {
|
|
renderModal({ isAndroidApp: true });
|
|
|
|
expect(screen.getByText(/will be uninstalled/i)).toBeVisible();
|
|
});
|
|
});
|