Skip to content

Commit

Permalink
Update cypress fixtures for fideslang 2.0 (#4114)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking authored Sep 18, 2023
1 parent 0f74db2 commit 4f33692
Show file tree
Hide file tree
Showing 10 changed files with 1,574 additions and 387 deletions.
8 changes: 3 additions & 5 deletions clients/admin-ui/cypress/e2e/consent-configuration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ describe("Consent configuration", () => {
cy.getByTestId("subrow-cell_0_Cookie name").contains("N/A");
cy.getByTestId("subrow-cell_0_Data use").contains("N/A");
cy.getByTestId("subrow-cell_1_Cookie name").contains("_ga");
cy.getByTestId("subrow-cell_1_Data use").contains(
"Advertising, Marketing or Promotion"
);
cy.getByTestId("subrow-cell_1_Data use").contains("advertising");
cy.getByTestId("subrow-cell_2_Cookie name").contains("cookie");
cy.getByTestId("subrow-cell_2_Data use").contains("System");
cy.getByTestId("subrow-cell_2_Data use").contains("Improve Service");
cy.getByTestId("subrow-cell_3_Cookie name").contains("cookie2");
cy.getByTestId("subrow-cell_3_Data use").contains("System");
cy.getByTestId("subrow-cell_3_Data use").contains("Improve Service");

cy.getByTestId("add-cookie-btn");
cy.getByTestId("add-vendor-btn");
Expand Down
10 changes: 7 additions & 3 deletions clients/admin-ui/cypress/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,20 +523,24 @@ describe("Dataset", () => {
"data-checked"
);
// the children of selected parents should be disabled
cy.getByTestId("checkbox-Credentials").click();
cy.get("[data-testid='checkbox-Password'] > span").should(
cy.getByTestId("checkbox-Authorization Information").click();
cy.get("[data-testid='checkbox-Account password'] > span").should(
"have.attr",
"data-checked"
);
cy.get("[data-testid='checkbox-Biometric Credentials'] > span").should(
"have.attr",
"data-disabled"
);
cy.get("[data-testid='checkbox-Password'] > span").should(
"have.attr",
"data-disabled"
);
cy.getByTestId("data-category-done-btn").click();
const expectedSelected = [
"system.authentication",
"system.operations",
"user.credentials",
"user.authorization",
];
expectedSelected.forEach((e) => {
cy.getByTestId("selected-categories").should("contain", e);
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/privacy-notices.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ describe("Privacy notices", () => {
consent_mechanism: "opt_in",
enforcement_level: "system_wide",
has_gpc_flag: true,
data_uses: ["advertising"],
data_uses: ["analytics"],
internal_description: "our very important notice, do not touch",
regions: ["us_ca"],
displayed_in_privacy_center: true,
Expand Down
4 changes: 2 additions & 2 deletions clients/admin-ui/cypress/e2e/taxonomy-plus.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ describe("Taxonomy management with Plus features", () => {
key: "user",
};
const RESOURCE_CHILD = {
label: "Biometric Data",
key: "user.biometric",
label: "Job Title",
key: "user.job_title",
};

const navigateToEditor = () => {
Expand Down
23 changes: 14 additions & 9 deletions clients/admin-ui/cypress/e2e/taxonomy.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ describe("Taxonomy management page", () => {
});

it("Can open up accordion to see taxonomy entities", () => {
// should only see the 3 root level taxonomy
// should only see the 2 root level taxonomy
cy.getByTestId("accordion-item-System Data").should("be.visible");
cy.getByTestId("accordion-item-User Data").should("be.visible");
cy.getByTestId("accordion-item-Payment Data").should("not.be.visible");

// clicking should open up accordions to render more items visible
cy.getByTestId("accordion-item-User Data").click();
cy.getByTestId("accordion-item-Credentials").should("be.visible");
cy.getByTestId("accordion-item-Credentials").click({ force: true });
cy.getByTestId("accordion-item-Authorization Information").should(
"be.visible"
);
cy.getByTestId("accordion-item-Authorization Information").click({
force: true,
});
cy.getByTestId("item-Password").should("be.visible");
});

Expand Down Expand Up @@ -103,9 +106,9 @@ describe("Taxonomy management page", () => {
},
{
tab: "Data Uses",
name: "Improve the capability",
name: "Functional",
key: "functional",
description: "Improve the product, service, application or system.",
description: "Used for specific, necessary, and legitimate purposes",
parentKey: "",
isParent: true,
request: "@putDataUse",
Expand Down Expand Up @@ -161,12 +164,14 @@ describe("Taxonomy management page", () => {
it("Can render the parent field", () => {
cy.getByTestId("tab-Data Categories").click();
cy.getByTestId(`accordion-item-User Data`).click();
cy.getByTestId("accordion-item-Credentials").click({ force: true });
cy.getByTestId("accordion-item-Authorization Information").click({
force: true,
});
cy.getByTestId("item-Password").trigger("mouseover");
cy.getByTestId("edit-btn").click();
cy.getByTestId("input-parent_key").should(
"have.value",
"user.credentials"
"user.authorization"
);
});

Expand Down Expand Up @@ -477,7 +482,7 @@ describe("Taxonomy management page", () => {
cy.getByTestId("accordion-item-User Data").trigger("mouseover");
cy.getByTestId("delete-btn").should("not.exist");
cy.getByTestId("accordion-item-User Data").click();
cy.getByTestId("item-Biometric Data").trigger("mouseover");
cy.getByTestId("item-Job Title").trigger("mouseover");
cy.getByTestId("delete-btn").should("not.exist");

// now try custom fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"origin": null,
"regions": ["fr", "ie"],
"consent_mechanism": "notice_only",
"data_uses": ["provide.service"],
"data_uses": ["essential"],
"enforcement_level": "not_applicable",
"disabled": false,
"has_gpc_flag": false,
Expand Down
Loading

0 comments on commit 4f33692

Please sign in to comment.