elm-explorations / test

Write unit and fuzz tests for Elm code.
https://package.elm-lang.org/packages/elm-explorations/test/latest
BSD 3-Clause "New" or "Revised" License
237 stars 39 forks source link

Add the ability to query for keyed nodes #83

Open frawa opened 5 years ago

frawa commented 5 years ago

In some cases having keyed html nodes makes a functional difference, so we want to test for it.

I'd like to write something like

          test "Keyed Button has the expected key" <|
            \_ ->
                Html.Keyed.node "button" [] [ ( "key1", Html.text "I'm a button!" ) ]
                    |> Query.fromHtml
                    |> Query.has [ Selector.key "key1" ]