diff --git a/src/ConfirmProvider/ConfirmProvider.test.tsx b/src/ConfirmProvider/ConfirmProvider.test.tsx index 3b2c59b8b..8c31df916 100644 --- a/src/ConfirmProvider/ConfirmProvider.test.tsx +++ b/src/ConfirmProvider/ConfirmProvider.test.tsx @@ -141,20 +141,6 @@ describe("useConfirm", () => { expect(queryByText("Arbitrary content")).toBeTruthy(); }); - test("keeps custom text during close", () => { - const { getByText, queryByText } = render( - - ); - fireEvent.click(getByText("Delete")); - expect(queryByText("Remove this item?")).toBeTruthy(); - fireEvent.click(getByText("Yes")); - expect(queryByText("Remove this item?")).toBeTruthy(); - }); - test("honours default options passed to the provider", () => { const { getByText, queryByText } = render( = ({ ); return ( - - {title && ( - // use the dialog title from the dialog title component - - {title} - - )} - - {content ? ( - - - theme.palette.mode === "light" - ? "rgba(0, 0, 0, 0.8)" - : "rgba(255,255,255, 1)" - }} + <> + {open ? ( + + {title && ( + // use the dialog title from the dialog title component + + {title} + + )} + + {content ? ( + + + theme.palette.mode === "light" + ? "rgba(0, 0, 0, 0.8)" + : "rgba(255,255,255, 1)" + }} + > + {content} + + + + ) : ( + description && ( + + + theme.palette.mode === "light" + ? "rgba(0, 0, 0, 0.8)" + : "rgba(255,255,255, 1)" + }} + > + {description} + + + ) + )} + + - {content} - - - - ) : ( - description && ( - - - theme.palette.mode === "light" - ? "rgba(0, 0, 0, 0.8)" - : "rgba(255,255,255, 1)" - }} - > - {description} - - - ) - )} - - - {dialogActions} - - + {dialogActions} + + + ) : null} + ); };