Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ describe('PolicyDeleteDialog', () => {
).toBeInTheDocument();
});

it('warns that the entire policy and all versions are deleted, not just the current version', () => {
render(
<PolicyDeleteDialog
isOpen={true}
onClose={onClose}
policy={basePolicy}
/>,
);
expect(
screen.getByText(/all of its versions/i),
).toBeInTheDocument();
expect(
screen.getByText(/not just the version you are currently viewing/i),
).toBeInTheDocument();
});

it('renders Delete button enabled for admin', () => {
render(
<PolicyDeleteDialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export function PolicyDeleteDialog({ isOpen, onClose, policy }: PolicyDeleteDial
<DialogHeader>
<DialogTitle>Delete Policy</DialogTitle>
<DialogDescription>
Are you sure you want to delete this policy? This action cannot be undone.
Are you sure you want to delete this policy? This permanently deletes the
entire "{policy.name}" policy and all of its versions, not just the version
you are currently viewing. This action cannot be undone.
</DialogDescription>
</DialogHeader>
<Form {...form}>
Expand Down
Loading