-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
DOM test class changes #8
Conversation
let targets = document.querySelectorAll(change.selector); | ||
for (let target of targets) { | ||
if (change.change == 'add') { | ||
target.classList.add(change.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing something - wouldn't this code mean that the added/removed classes were always added/removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it'll happen every time a variant lands on the page with a class add/removal, but that will only happen some of the time. fwiw DomTests.php:76 is where that random selection happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, looks good! Left one code question
Adds a "change classes" aspect to DOM tests: add a class or remove a class.
Example: "turn the nav donate button pink"
