Add markdown label test for Block

This commit is contained in:
Micah Hahn 2023-04-05 10:31:16 -05:00
parent 27af57ef33
commit 728b4c08c5

View File

@ -16,6 +16,7 @@ spec =
describe "Nri.Ui.Block.V4"
[ describe "content" contentSpec
, describe "labelId" labelIdSpec
, describe "labelMarkdown" labelMarkdownSpec
, describe "getLabelPositions" getLabelPositionsSpec
]
@ -94,6 +95,20 @@ labelIdSpec =
]
labelMarkdownSpec : List Test
labelMarkdownSpec =
[ test "An emphasized word with a markdown label" <|
\_ ->
[ Block.plaintext "Hello there"
, Block.emphasize
, Block.labelId "yo-id"
, Block.label "This **is** markdown"
]
|> toQuery
|> Query.has [ Selector.text "This is markdown" ]
]
toQuery : List (Block.Attribute a) -> Query.Single a
toQuery block =
Block.view block