eeue56 / eeue56/elm-html-test

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

Open
#67 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elm
Stars
68
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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
```elm
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the Elm example in the report, then locate the implementation of Selector.containing and its use through Query.has. Check the behavior against the provided button and outside text, and consider the issue done when the selector no longer matches text outside the candidate element and the example fails as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.