Skip to content

Add Cypress tests for fidesString overriding existing cookie#7290

Merged
gilluminate merged 2 commits intomainfrom
gill/ENG-2487/automated-consent-tests
Feb 3, 2026
Merged

Add Cypress tests for fidesString overriding existing cookie#7290
gilluminate merged 2 commits intomainfrom
gill/ENG-2487/automated-consent-tests

Conversation

@gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Feb 2, 2026

Ticket ENG-2487

Description Of Changes

Add comprehensive Cypress tests to verify that fidesString (notice consent string) correctly overrides existing cookie values during FidesJS initialization.

Code Changes

  • Add new test suite "when Notice Consent string is found and takes precedence over existing cookie values"
  • Test verifies fidesString overrides existing cookie consent values
  • Test confirms API receives SCRIPT consent method with correct preferences
  • Test validates cookie is updated with new values while preserving device ID
  • Test checks modal UI displays correct overridden values

Steps to Confirm

  1. Review the new test suite in consent-banner.cy.ts
  2. Verify tests cover the scenario where existing cookie values are overridden by fidesString

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
  • UX feedback:
    • No UX review needed
  • Followup issues:
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

@vercel
Copy link
Contributor

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Feb 2, 2026 7:11pm
fides-privacy-center Ignored Ignored Feb 2, 2026 7:11pm

Request Review

@gilluminate gilluminate requested a review from jpople February 2, 2026 19:12
@gilluminate gilluminate marked this pull request as ready for review February 2, 2026 19:12
@gilluminate gilluminate requested a review from a team as a code owner February 2, 2026 19:12
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

This PR adds comprehensive Cypress test coverage for verifying that fidesString (notice consent string) correctly overrides existing cookie values during FidesJS initialization.

Changes Made

  • Added new test suite "when Notice Consent string is found and takes precedence over existing cookie values" with 4 test cases
  • Tests verify that fidesString preferences override existing cookie consent values
  • Tests confirm API receives SCRIPT consent method with correct preferences
  • Tests validate cookie updates with new values while preserving device ID
  • Tests check modal UI displays correct overridden values
  • Added changelog entry documenting the test additions

Test Quality

The tests follow established patterns in the codebase and provide good coverage of the fidesString override behavior. The test implementation is thorough, checking multiple aspects:

  1. The in-memory consent object reflects the override
  2. The API call includes the SCRIPT method and correct preferences
  3. The cookie is updated appropriately
  4. The UI displays the correct state

File Size Consideration

The test file consent-banner.cy.ts now exceeds 4300 lines. While these tests are valuable, consider creating separate test files for new test suites to improve maintainability.

Confidence Score: 4/5

  • This PR is safe to merge with the minor consideration that the test file is becoming very large
  • The changes add well-structured test coverage following existing patterns in the codebase. The tests are comprehensive and verify multiple aspects of the fidesString override behavior. The only concern is the growing size of the test file (4300+ lines), which is a maintainability consideration rather than a functional issue.
  • No files require special attention - the test implementation follows established patterns

Important Files Changed

Filename Overview
changelog/7290-automated-consent-tests.yaml Added standard changelog entry for test additions
clients/privacy-center/cypress/e2e/fides-js/consent-banner.cy.ts Added 130 lines of test coverage for fidesString overriding cookie values; file now exceeds 4300 lines

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@gilluminate gilluminate removed the request for review from a team February 3, 2026 16:10
@gilluminate gilluminate force-pushed the gill/ENG-2487/automated-consent-tests branch from c539fdc to 604ed09 Compare February 3, 2026 16:11
@gilluminate gilluminate added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit f87fa4a Feb 3, 2026
39 checks passed
@gilluminate gilluminate deleted the gill/ENG-2487/automated-consent-tests branch February 3, 2026 16:28
@greptile-apps greptile-apps bot mentioned this pull request Feb 6, 2026
18 tasks
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