-
Notifications
You must be signed in to change notification settings - Fork 41
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
Test.Html.Query.has wrongfully returns a failed expectation even when the clauses in the Selector are there #134
Comments
I'm having the same issue:
|
svg's internally are seen by elm as The class selector you are using is really only going to work for html elements not svg's which I don't think is a bug, albeit, it's not an intuitive limitation. Have you tried using an attribute selector to find the class?
I think a specific selector for svg classes should be added. elm-css had a similar issue which you can read about here. There's a fix at the current time of writing this which we are waiting to get merged. |
Actually looks like |
Here is the reason attribute selector will not work with svg classes. It's treating the attribute "class" like a regular html class. Later it will look for the class in a record under key "className" which it will of course not find because svg's set their classes as an "attribute" with the key of "class". Ok (InternalTypes.Attribute { key, value }) ->
if String.toLower key == "class" then
value
|> String.split " "
|> Classes
else
namedAttr key value If you just return |
Hello, I'm seeing the following error in a test:
as you can see
Query.index 0
finds ansvg
withsome-class-type-1
, and I use aQuery.has [ class "some-class-type-1" ]
. However, it reports as not having that classsome-class-type-1
. AFAIK, this is a bug becauseQuery.has
is supposed to return a successful expectation if theSelector
clauses given to it are true, which they seem to be in this case.I'm providing the test code below:
If there's any further information I can give please do tell.
Thank you
The text was updated successfully, but these errors were encountered: