mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-05 08:34:38 +03:00
Adds tests against clicking a static element
This commit is contained in:
parent
83f92d0267
commit
4a928460c8
@ -20,13 +20,34 @@ import Test.Html.Selector as Selector exposing (Selector)
|
||||
spec : Test
|
||||
spec =
|
||||
describe "Nri.Ui.Highlighter"
|
||||
[ describe "keyboard behavior" keyboardTests
|
||||
[ describe "mouse behavior" mouseTests
|
||||
, describe "keyboard behavior" keyboardTests
|
||||
, describe "markdown behavior" markdownTests
|
||||
, describe "joinAdjacentInteractiveHighlights" joinAdjacentInteractiveHighlightsTests
|
||||
, describe "overlapping highlights" overlappingHighlightTests
|
||||
]
|
||||
|
||||
|
||||
mouseTests : List Test
|
||||
mouseTests =
|
||||
[ test "clicking on a static element does nothing" <|
|
||||
\() ->
|
||||
[ Highlightable.initStatic [] 0 "Pothos", Highlightable.initInteractive [] 1 "Philodendron" ]
|
||||
|> program { markerName = Nothing, joinAdjacentInteractiveHighlights = False }
|
||||
|> click "Pothos"
|
||||
|> ensureViewHasNot [ Selector.tag "mark" ]
|
||||
|> done
|
||||
, test "starting a highlight from a static element works" <|
|
||||
\() ->
|
||||
[ Highlightable.initStatic [] 0 "Pothos", Highlightable.initInteractive [] 1 "Philodendron" ]
|
||||
|> program { markerName = Nothing, joinAdjacentInteractiveHighlights = False }
|
||||
|> mouseDown "Philodendron"
|
||||
|> mouseUp "Pothos"
|
||||
|> ensureMarked [ "Philodendron" ]
|
||||
|> done
|
||||
]
|
||||
|
||||
|
||||
keyboardTests : List Test
|
||||
keyboardTests =
|
||||
[ test "has a focusable element when there is one" <|
|
||||
|
Loading…
Reference in New Issue
Block a user