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 support for nested options.customOptionsPath #4491

Merged
merged 7 commits into from
Dec 7, 2023

Conversation

NevilleS
Copy link
Contributor

@NevilleS NevilleS commented Dec 7, 2023

Fixes #PROD-1243

Description Of Changes

When testing PROD-1243 (from #4462) I found that I could cause Fides.init(...) to crash by supplying a nested options.customOptionsPath that didn't exist, e.g.

Fides.init({
  options: {
    customOptionsPath: "window.nonexistent_object.nested.path",
  },
  ...
})

This throws an error like:

(uncaught exception)TypeError: Cannot read properties of undefined (reading 'nested')

Code Changes

  • Added failing Cypress tests to consent-banner-tcf.cy.ts
  • Added failing unit tests to consent-utils.test.ts
  • Fix getWindowObjFromPath to be defensive when descending nested paths

Steps to Confirm

  • Run Cypress tests & unit tests 👍

Pre-Merge Checklist

Copy link

vercel bot commented Dec 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2023 2:19pm

Copy link

cypress bot commented Dec 7, 2023

Passing run #5543 ↗︎

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 7c1b2c5 into cbf2ecc...
Project: fides Commit: 02406d44ea ℹ️
Status: Passed Duration: 00:32 💡
Started: Dec 7, 2023 2:30 PM Ended: Dec 7, 2023 2:31 PM

Review all test suite changes for PR #4491 ↗︎

@NevilleS NevilleS marked this pull request as ready for review December 7, 2023 02:09
@NevilleS NevilleS merged commit dae3113 into main Dec 7, 2023
13 checks passed
@NevilleS NevilleS deleted the PROD-1243-ns-fix-undefined-custom-options-path branch December 7, 2023 16:46
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