Skip to content

Commit da6c058

Browse files
committed
LJ-458-FE-Consent-reporting-page-initial-UI (#5839)
1 parent 1d97780 commit da6c058

25 files changed

+1779
-142
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
2626

2727
### Added
2828
- Fides GTM & event origination [#5821](https://github.com/ethyca/fides/pull/5821)
29+
- Added a consent reporting table and consent lookup feature [#5839](https://github.com/ethyca/fides/pull/5839)
2930

3031
### Fixed
3132
- Addressed TCModel console error when opting into some purposes [#5850](https://github.com/ethyca/fides/pull/5850)

clients/admin-ui/cypress/e2e/consent-reporting.cy.ts

+73-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe("Consent reporting", () => {
4040
});
4141
});
4242

43-
describe("downloading reports", () => {
43+
describe("results view and download report", () => {
4444
beforeEach(() => {
4545
stubPlus(true, {
4646
core_fides_version: "1.9.6",
@@ -70,10 +70,80 @@ describe("Consent reporting", () => {
7070
url: "/api/v1/plus/consent_reporting*",
7171
method: "GET",
7272
}).as("getConsentReport");
73-
cy.getByTestId("input-from-date").type("2023-11-01");
74-
cy.getByTestId("input-to-date").type("2023-11-07");
73+
cy.getByTestId("input-date-range").first().type("2023-11-01");
74+
cy.getByTestId("input-date-range").last().type("2023-11-07");
7575
cy.getByTestId("download-btn").click();
76+
cy.getByTestId("download-report-btn").click();
7677
cy.wait("@getConsentReport");
7778
});
79+
it("can lookup specific consent preferences", () => {
80+
cy.intercept({
81+
url: "/api/v1/current-privacy-preferences*",
82+
method: "GET",
83+
}).as("lookupConsentPreferences");
84+
cy.getByTestId("consent-reporting-dropdown-btn").click();
85+
cy.getByTestId("consent-preference-lookup-btn").click();
86+
cy.getByTestId("subject-search-input").type("[email protected]{enter}");
87+
cy.wait("@lookupConsentPreferences").then((interception) => {
88+
const { url: requestUrl } = interception.request;
89+
let url = new URL(requestUrl);
90+
let params = new URLSearchParams(url.search);
91+
expect(params.get("email")).to.equal("[email protected]");
92+
expect(params.get("phone_number")).to.equal("[email protected]");
93+
expect(params.get("fides_user_device_id")).to.equal("[email protected]");
94+
expect(params.get("external_id")).to.equal("[email protected]");
95+
});
96+
});
97+
it("loads the consent report table without date filters", () => {
98+
cy.intercept(
99+
{
100+
url: "/api/v1/historical-privacy-preferences*",
101+
method: "GET",
102+
},
103+
{
104+
fixture: "consent-reporting/historical-privacy-preferences.json",
105+
},
106+
).as("getConsentReport");
107+
108+
cy.wait("@getConsentReport").then((interception) => {
109+
const { url: requestUrl } = interception.request;
110+
let url = new URL(requestUrl);
111+
let params = new URLSearchParams(url.search);
112+
expect(params.get("request_timestamp_gt")).to.be.null;
113+
expect(params.get("request_timestamp_lt")).to.be.null;
114+
});
115+
116+
cy.getByTestId("fidesTable-body").children().should("have.length", 22);
117+
});
118+
it("loads the consent report table with date filters", () => {
119+
cy.intercept(
120+
{
121+
url: "/api/v1/historical-privacy-preferences*",
122+
method: "GET",
123+
},
124+
{
125+
fixture: "consent-reporting/historical-privacy-preferences.json",
126+
},
127+
).as("getConsentReport");
128+
129+
cy.wait("@getConsentReport");
130+
131+
cy.getByTestId("input-date-range").first().type("2023-11-01");
132+
cy.getByTestId("input-date-range").last().type("2023-11-07{enter}");
133+
134+
cy.wait("@getConsentReport").then((interception) => {
135+
const { url: requestUrl } = interception.request;
136+
let url = new URL(requestUrl);
137+
let params = new URLSearchParams(url.search);
138+
expect(params.get("request_timestamp_gt")).to.equal(
139+
"2023-11-01T00:00:00.000Z",
140+
);
141+
expect(params.get("request_timestamp_lt")).to.equal(
142+
"2023-11-07T23:59:59.999Z",
143+
);
144+
});
145+
146+
cy.getByTestId("fidesTable-body").children().should("have.length", 22);
147+
});
78148
});
79149
});

0 commit comments

Comments
 (0)