From dc6cf08cd2e91b123b662f5c65bc7b99d6a5ee74 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Wed, 5 Apr 2023 15:00:00 -0600 Subject: [PATCH] Adds failing tests against the tag --- tests/Spec/Nri/Ui/Highlighter.elm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/Spec/Nri/Ui/Highlighter.elm b/tests/Spec/Nri/Ui/Highlighter.elm index 0380ed2b..a40b36f8 100644 --- a/tests/Spec/Nri/Ui/Highlighter.elm +++ b/tests/Spec/Nri/Ui/Highlighter.elm @@ -1,5 +1,6 @@ module Spec.Nri.Ui.Highlighter exposing (spec) +import Accessibility.Aria as Aria import Accessibility.Key as Key import Expect exposing (Expectation) import Html.Styled exposing (Html, toUnstyled) @@ -353,7 +354,18 @@ markdownHighlightNameTests = |> toUnstyled |> Query.fromHtml |> Expect.all - [ hasBefore "start Markdown label highlight" "Highlightable" + [ -- The rendered markdown tag should be hidden from SR users, since the label information + -- is conveyed another way + Query.has + [ Selector.attribute (Aria.hidden True) + , Selector.containing + [ Selector.tag "strong" + , Selector.containing [ Selector.text "Markdown label " ] + ] + ] + , -- The before and after elements that convey the mark type to AT users + -- should not include markdown (e.g., no asterisks) + hasBefore "start Markdown label highlight" "Highlightable" ] in [ testIt "view" Highlighter.view