mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-27 15:38:43 +00:00
* ignore case when confirming deletes * Test confirmation of deletes works when case differs Added test case for 'delete' as the confirmation text.
This commit is contained in:
parent
c11fb01805
commit
0abd7d9c28
@ -80,6 +80,24 @@ describe('Test DeleteWidgetV1 Component', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('Delete click should work properly regardless of capitalization', async () => {
|
||||
await act(async () => {
|
||||
render(<DeleteWidgetModal {...mockProps} />);
|
||||
|
||||
const inputBox = await screen.findByTestId('confirmation-text-input');
|
||||
const confirmButton = await screen.findByTestId('confirm-button');
|
||||
const hardDelete = await screen.findByTestId('hard-delete');
|
||||
|
||||
userEvent.click(hardDelete);
|
||||
|
||||
userEvent.type(inputBox, 'delete');
|
||||
|
||||
expect(confirmButton).not.toBeDisabled();
|
||||
|
||||
userEvent.click(confirmButton);
|
||||
});
|
||||
});
|
||||
|
||||
it('Discard click should work properly', async () => {
|
||||
await act(async () => {
|
||||
render(<DeleteWidgetModal {...mockProps} />);
|
||||
|
||||
@ -124,7 +124,7 @@ const DeleteWidgetModal = ({
|
||||
|
||||
const isDeleteTextPresent = useMemo(() => {
|
||||
return (
|
||||
deleteConfirmationText === DELETE_CONFIRMATION_TEXT &&
|
||||
deleteConfirmationText.toLowerCase() === DELETE_CONFIRMATION_TEXT.toLowerCase() &&
|
||||
(deletionType === DeleteType.SOFT_DELETE ||
|
||||
deletionType === DeleteType.HARD_DELETE)
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user