Skip to content
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

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

allisonking
Copy link
Contributor

Closes #3485

Code Changes

  • list your code changes here

Steps to Confirm

  • list any manual steps for reviewers to confirm the changes

Pre-Merge Checklist

Description Of Changes

Write some things here about the changes and any potential caveats

@@ -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");
Copy link
Contributor Author

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

image

showing both the modal and overlay. I think what is happening is

  1. the page loads, the banner does not appear yet because it is still animating in
  2. 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)
  3. 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

Copy link
Contributor

@eastandwestwind eastandwestwind Jun 7, 2023

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cypress
Copy link

cypress bot commented Jun 7, 2023

Passing run #2518 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge ea3600e into 6472640...
Project: fides Commit: b72180dd22 ℹ️
Status: Passed Duration: 01:01 💡
Started: Jun 7, 2023 4:29 PM Ended: Jun 7, 2023 4:30 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@allisonking allisonking marked this pull request as ready for review June 7, 2023 16:40
@allisonking allisonking merged commit bf6111e into feature/privacy-components Jun 7, 2023
@allisonking allisonking deleted the aking/3485/fix-cy-tests branch June 7, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants