elm-explorations / elm-explorations/test

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

Open
#213 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
244
Forks
40
Avg merge
1d 23h
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.