From 5beaa996ab8af57f1c78860830d43d6dd9f1c08b Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 2 Aug 2023 19:53:04 +0200 Subject: [PATCH] test: added export dialog tests and update button tests --- src/components/Button.jsx | 10 +- src/components/Button.test.jsx | 32 +++++-- src/components/ExportDialog.test.jsx | 93 +++++++++++++++++++ .../__snapshots__/Button.test.jsx.snap | 9 -- 4 files changed, 123 insertions(+), 21 deletions(-) create mode 100644 src/components/ExportDialog.test.jsx delete mode 100644 src/components/__snapshots__/Button.test.jsx.snap diff --git a/src/components/Button.jsx b/src/components/Button.jsx index e0a1aae4..61546b8d 100644 --- a/src/components/Button.jsx +++ b/src/components/Button.jsx @@ -9,16 +9,15 @@ export const Button = props => { "o-70 cursor-not-allowed": props.disabled, "w-full": props.fullWidth, }); - return ( -
+
{!!props.icon && ( -
+
{props.icon}
)} {!!props.text && ( -
+
{props.text}
)} @@ -27,6 +26,7 @@ export const Button = props => { }; Button.defaultProps = { + testid: "btn", className: "", text: "", textClassName: "", @@ -40,6 +40,7 @@ Button.defaultProps = { export const PrimaryButton = props => (