diff --git a/packages/module/src/WarningModal/WarningModal.test.tsx b/packages/module/src/WarningModal/WarningModal.test.tsx index 6eda1571..9467870e 100644 --- a/packages/module/src/WarningModal/WarningModal.test.tsx +++ b/packages/module/src/WarningModal/WarningModal.test.tsx @@ -4,12 +4,13 @@ import WarningModal from './WarningModal'; describe('WarningModal component', () => { const initialProps = { - onConfirm: jest.fn(), - children: <>By confirming this action, unsaved data may be lost. Do you want to continue? + title: 'Unsaved changes', + onClose: () => null, + onConfirm: () => null, }; it('should render', () => { - const { container } = render(); - expect(container.firstChild).toMatchSnapshot(); + const container = render(Warning modal content); + expect(container).toMatchSnapshot(); }); }); \ No newline at end of file diff --git a/packages/module/src/WarningModal/WarningModal.tsx b/packages/module/src/WarningModal/WarningModal.tsx index d36c50e7..5f5f25b6 100644 --- a/packages/module/src/WarningModal/WarningModal.tsx +++ b/packages/module/src/WarningModal/WarningModal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, ModalProps, Modal, ModalVariant, ButtonVariant, variantIcons, } from '@patternfly/react-core'; +import { Button, ModalProps, Modal, ModalVariant, ButtonVariant } from '@patternfly/react-core'; export interface WarningModalProps extends Omit { /** Callback for the confirm action button. */ diff --git a/packages/module/src/WarningModal/__snapshots__/WarningModal.test.tsx.snap b/packages/module/src/WarningModal/__snapshots__/WarningModal.test.tsx.snap new file mode 100644 index 00000000..8bc5beaf --- /dev/null +++ b/packages/module/src/WarningModal/__snapshots__/WarningModal.test.tsx.snap @@ -0,0 +1,183 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`WarningModal component should render 1`] = ` +{ + "asFragment": [Function], + "baseElement": +