-
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
Added FidesUpdating event #4816
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Passing run #7360 ↗︎
Details:
Review all test suite changes for PR #4816 ↗︎ |
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 looks good, thanks. I tested this out and updated some Cypress tests as well, so I'm pretty confident this is ready to ship.
// Both FidesUpdating & FidesUpdated should include the fides_string | ||
cy.get("@FidesUpdating") | ||
.should("have.been.calledOnce") | ||
.its("lastCall.args.0.detail.fides_string") | ||
.then((fidesString) => { | ||
const parts = fidesString.split(","); | ||
expect(parts.length).to.eql(2); | ||
expect(parts[1]).to.eql(acceptAllAcString); | ||
}); |
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 added this test to be sure 👍
cy.get("@FidesUpdating") | ||
// Updating event, when the user rejects all | ||
.should("have.been.calledOnce") | ||
.its("firstCall.args.0.detail.consent") | ||
.should("deep.equal", { | ||
[PRIVACY_NOTICE_KEY_1]: false, | ||
[PRIVACY_NOTICE_KEY_2]: true, | ||
[PRIVACY_NOTICE_KEY_3]: false, | ||
}); |
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 updated this test (and others) to confirm this event does what we expect
// Toggle the notice, but don't save yet | ||
cy.getByTestId("toggle-Advertising").click(); | ||
cy.get("@FidesUIChanged").should("have.been.calledOnce"); | ||
cy.get("@FidesUpdating").should("not.have.been.called"); | ||
cy.get("@FidesUpdated").should("not.have.been.called"); |
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.
Unrelated to this change, but I made this test a bit better.
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.
Thanks for getting the tests in place 👍
Closes https://ethyca.atlassian.net/browse/PROD-1965
Description Of Changes
Adds a new
FidesUpdating
even that fires (almost) immediately after the user has updated their consent. This allows page code to react to the change sooner thanFidesUpdated
as that will potentially make a network request to save the preferences before firing.Pre-Merge Checklist
CHANGELOG.md