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.all does not fail if any descendants match the given selectors #213

Open
decioferreira opened this issue Mar 1, 2023 · 0 comments · May be fixed by #214
Open

Selector.all does not fail if any descendants match the given selectors #213

decioferreira opened this issue Mar 1, 2023 · 0 comments · May be fixed by #214

Comments

@decioferreira
Copy link

To reproduce:

Html.fieldset [ Attributes.disabled False ]
    [ Html.button [ Attributes.disabled True ]
        [ Html.text "Reply"
        ]
    ]
    |> Query.fromHtml
    |> Query.has
        [ Selector.all
            [ Selector.tag "fieldset"
            , Selector.attribute (Attributes.disabled True)
            ]
        ]

Another example with a class selector:

Html.fieldset []
    [ Html.button [ Attributes.class "btn btn-large" ]
        [ Html.text "Reply"
        ]
    ]
    |> Query.fromHtml
    |> Query.has
        [ Selector.all
            [ Selector.tag "fieldset"
            , Selector.class "btn"
            ]
        ]

Link to running examples: https://ellie-app.com/m7RYfvvLvjPa1

Actual result: it passes (because there is a descendant that matches the second selector)

Expected result: my understanding is that Selector.all allows us to find a single HTML element that matches all given selectors - if this is not the case, then I would say the description of this function should be clarified

Janiczek added a commit that referenced this issue Mar 1, 2023
@Janiczek Janiczek linked a pull request Mar 1, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant