You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After an element has been passed to the handleInvalidTarget method, calling the removeAttribute function with any attribute except "target" will fail.
This is because the function has been overwritten with an implementation that's intended to special case "target", but which actually does nothing for non-"target" attributes.
Desired behavior
For non-"target" attributes, I would expect removeAttribute to continue to function as normal.
Test code to reproduce
I haven't properly determined under what conditions handleInvalidTarget is called. In my own test, I ran into this while my application was trying to control the disabled state of a link as I passed and failed various validation conditions.
Cypress Version
12.8.1
Node version
Standalone app (Mac)
Operating System
13.2
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered:
Hi @pvande. Thank you for opening your first issue in cypress! What you are describing sounds like it could be a problem. The intended behavior is for attributes that are "non-target" should just pass through as normal. Would you be able to help us reproduce this issue to see what is going on, perhaps with a reproduction repository?
Unfortunately my time for dealing with this issue is presently very short, so I'm not going to be able to build a reproduction case at this time. However, the function in question (lines 71–79 in the same file you linked to) is not long (three lines of code inside a conditional), and clearly does not implement the intended behavior (there is no code that runs if the "target" condition is not met).
I've hacked a workaround into my own test suite by deleteing the removeAttribute override before use, which works adequately.
oh I see what you are saying now. I linked to the wrong function 🤦🏻♂️ . The function in question is here. That seems like a bug to me and you're right, its a complete no-op without target. Going to route this over to the team.
nagash77
added
E2E
Issue related to end-to-end testing
Triaged
Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
and removed
routed-to-e2e
labels
Apr 19, 2023
jodysalt
added a commit
to jodysalt/cypress
that referenced
this issue
Jul 16, 2023
Current behavior
After an element has been passed to the
handleInvalidTarget
method, calling theremoveAttribute
function with any attribute except"target"
will fail.This is because the function has been overwritten with an implementation that's intended to special case
"target"
, but which actually does nothing for non-"target"
attributes.Desired behavior
For non-
"target"
attributes, I would expectremoveAttribute
to continue to function as normal.Test code to reproduce
I haven't properly determined under what conditions
handleInvalidTarget
is called. In my own test, I ran into this while my application was trying to control thedisabled
state of a link as I passed and failed various validation conditions.Cypress Version
12.8.1
Node version
Standalone app (Mac)
Operating System
13.2
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: