-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix consent-banner cypress tests #3487
Fix consent-banner cypress tests #3487
Conversation
Co-authored-by: eastandwestwind <[email protected]>
@@ -946,12 +946,11 @@ describe("Consent banner", () => { | |||
}); | |||
|
|||
it("closes banner and opens modal when modal link is clicked", () => { | |||
cy.get("div#fides-banner").should("exist"); | |||
cy.get("div#fides-banner").should("be.visible"); |
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.
this is a little subtle—the banner always exists, we just move it out of the screen so that we can animate it. the odd thing is that without this change, the env would end up as
showing both the modal and overlay. I think what is happening is
- the page loads, the banner does not appear yet because it is still animating in
- cypress clicks on the modal link, so the modal opens (also sets that the banner should not be open, but I think at this point the banner isn't technically open yet because of
delayBanner
) - now the banner has finished animating so both the modal and banner are open!
by waiting for the banner to be visible, that delays cypress enough so that the banner is set to open, then the logic all works accordingly.
this is probably a bug, so maybe it should be skipped instead of the fix I put in 🤔 let me know what you think @eastandwestwind . I think if a user were very speedy, they could trigger this by clicking on the modal link before the banner has appeared
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 think this cypress adjustment is fine for this PR, especially as the odds that a user immediately clicks on consent (usually in the footer of a site) before the banner slides in is slim.
I'll create a follow-up for this bug fix, and will prioritize this upcoming sprint
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.
Passing run #2518 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Closes #3485
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
Write some things here about the changes and any potential caveats