From bc7d536b2fa290dcefe4ccf49ee42090d10ab513 Mon Sep 17 00:00:00 2001 From: charbelrami Date: Thu, 26 Oct 2023 12:22:58 -0300 Subject: [PATCH] add ClickableText icon rendering tests --- tests/Spec/Nri/Ui/ClickableText.elm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Spec/Nri/Ui/ClickableText.elm b/tests/Spec/Nri/Ui/ClickableText.elm index 7468326f2..a27d12e29 100644 --- a/tests/Spec/Nri/Ui/ClickableText.elm +++ b/tests/Spec/Nri/Ui/ClickableText.elm @@ -36,6 +36,8 @@ elementTests = [ testAsButton , testAsAnchor , testIconAsSvg + , testRightIconAsSvg + , testLinkExternalIconAsSvg ] @@ -66,6 +68,24 @@ testIconAsSvg = |> done +testRightIconAsSvg : Test +testRightIconAsSvg = + test "renders an svg element when a right icon is provided" <| + \() -> + program Button [ ClickableText.rightIcon UiIcon.arrowLeft ] + |> ensureViewHas [ tag "svg" ] + |> done + + +testLinkExternalIconAsSvg : Test +testLinkExternalIconAsSvg = + test "renders an svg element when an external link is provided" <| + \() -> + program Link [ ClickableText.linkExternal "https://example.com" ] + |> ensureViewHas [ tag "svg" ] + |> done + + attributeTests : List Test attributeTests = [ testHref