Skip to content

Commit

Permalink
Add an automated test to check for /fides-consent.js backwards compat…
Browse files Browse the repository at this point in the history
…ibility (#3289)
  • Loading branch information
NevilleS authored May 12, 2023
1 parent 8b0fd67 commit 4e2b6ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fides/compare/2.13.0...main)

### Added

- Add an automated test to check for `/fides-consent.js` backwards compatibility [#3289](https://github.com/ethyca/fides/pull/3289)

## [2.13.0](https://github.com/ethyca/fides/compare/2.12.1...2.13.0)

### Added
Expand Down
14 changes: 14 additions & 0 deletions clients/privacy-center/cypress/e2e/fides-js.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ describe("fides.js API route", () => {
});
});

it("supports /fides-consent.js route for backwards-compatibility", () => {
cy.request("/fides-consent.js").then((legacyResponse) => {
expect(legacyResponse.status).to.eq(200);
expect(legacyResponse)
.to.have.property("headers")
.to.have.property("content-type")
.to.eql("application/javascript");

cy.request("/fides.js").then((standardResponse) => {
expect(standardResponse.body).equals(legacyResponse.body);
});
});
});

describe("when pre-fetching location", () => {
it("returns location if provided as a '?location' query param", () => {
cy.request("/fides.js?location=US-CA").then((response) => {
Expand Down

0 comments on commit 4e2b6ff

Please sign in to comment.