Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selector.containing matches text anywhere in the Single, instead of only matching the candidate element #67

Open
brookeangel opened this issue Jul 10, 2018 · 0 comments

Comments

@brookeangel
Copy link
Contributor

elm-html-test 5.2.0

The following test should fail because the text "outside" is not within the "button" tag. But it currently passes. (Though strangely, Query.hasNot with the same selectors also passes.)

https://ellie-app.com/KDBTJfMSp8a1

module Main exposing (main)

import Expect
import Html exposing (Html, text)
import Html.Attributes exposing (selected)
import Test exposing (..)
import Test.Html.Query as Query
import Test.Html.Selector as Selector exposing (attribute, containing, tag)


main : Html msg
main =
    Html.div []
        [ text "outside"
        , Html.button [] [ Html.text "Button" ]
        ]
        |> Query.fromHtml
        |> Query.has
            [ tag "button"
            , containing [ Selector.text "outside" ]
            ]
        |> toString
        |> Html.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant