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": + + + + + + + + + + + + + + + + + + + + + Warning alert: + + + Unsaved changes + + + + + Warning modal content + + + + + + + , + "container": , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`;