Skip to content

Commit

Permalink
add ClickableText icon rendering tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charbelrami committed Oct 26, 2023
1 parent 4f99c13 commit bc7d536
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Spec/Nri/Ui/ClickableText.elm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ elementTests =
[ testAsButton
, testAsAnchor
, testIconAsSvg
, testRightIconAsSvg
, testLinkExternalIconAsSvg
]


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bc7d536

Please sign in to comment.