diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.test.tsx index ea3402f9c2e8..5a4b09c35cfb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.test.tsx @@ -80,6 +80,24 @@ describe('Test DeleteWidgetV1 Component', () => { }); }); + it('Delete click should work properly regardless of capitalization', async () => { + await act(async () => { + render(); + + 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(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx index 14907f68a1fe..d7f3e97ff6e3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx @@ -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) );