diff --git a/clients/admin-ui/cypress/e2e/datasets.cy.ts b/clients/admin-ui/cypress/e2e/datasets.cy.ts index 23218c9e29..65e13fac50 100644 --- a/clients/admin-ui/cypress/e2e/datasets.cy.ts +++ b/clients/admin-ui/cypress/e2e/datasets.cy.ts @@ -162,155 +162,6 @@ describe("Dataset", () => { cy.getByTestId("row-0-col-name").contains("uuid"); cy.getByTestId("row-1-col-name").should("not.exist"); }); - - describe("Data category checkbox tree", () => { - it("Can render chosen data categories", () => { - cy.visit("/dataset/demo_users_dataset/users"); - cy.getByTestId("row-5-col-actions").find("button").click(); - - cy.getByTestId("data-category-dropdown").click(); - cy.get("[data-testid='checkbox-Unique ID'] > span").should( - "have.attr", - "data-checked", - ); - cy.get(`[data-testid='checkbox-User Data'] > span`).should( - "have.attr", - "data-indeterminate", - ); - cy.getByTestId("selected-categories").should( - "contain", - "user.unique_id", - ); - }); - - it.only("Can deselect data categories", () => { - cy.visit("/dataset/demo_users_dataset/users"); - cy.getByTestId("row-5-col-actions").find("button").click(); - - cy.getByTestId("data-category-dropdown").click(); - cy.getByTestId("checkbox-Unique ID").click(); - // should collapse away - cy.getByTestId("checkbox-Unique ID").should("not.exist"); - cy.get("[data-testid='checkbox-User Data'] > span").should( - "not.have.attr", - "data-indeterminate", - ); - cy.getByTestId("data-category-done-btn").click(); - cy.getByTestId("selected-categories").should( - "not.contain", - "user.derived.identifiable.unique_id", - ); - cy.getByTestId("save-btn").click({ force: true }); - cy.wait("@putDataset").then((interception) => { - const { body } = interception.request; - expect(body.collections[0].fields[5].data_categories).to.eql([]); - }); - }); - - it("Can select more data categories", () => { - cy.visit("/dataset/demo_users_dataset"); - cy.getByTestId("row-5-col-actions").find("button").click(); - cy.getByTestId("data-category-dropdown").click(); - cy.getByTestId("checkbox-Telemetry Data").click(); - cy.getByTestId("checkbox-System Data").click(); - cy.getByTestId("data-category-done-btn").click(); - cy.getByTestId("selected-categories").should( - "contain", - "user.unique_id", - ); - cy.getByTestId("selected-categories").should( - "contain", - "user.telemetry", - ); - cy.getByTestId("selected-categories").should("contain", "system"); - cy.getByTestId("save-btn").click({ force: true }); - cy.wait("@putDataset").then((interception) => { - const { body } = interception.request; - expect(body.collections[0].fields[5].data_categories).to.eql([ - "user.unique_id", - "user.telemetry", - "system", - ]); - }); - }); - - it("Can interact with the checkbox tree properly", () => { - cy.visit("/dataset/demo_users_dataset"); - cy.getByTestId("row-5-col-actions").find("button").click(); - cy.getByTestId("data-category-dropdown").click(); - // expand system data - cy.getByTestId("expand-System Data").click(); - // select 1/2 children - cy.getByTestId("checkbox-Authentication Data").click(); - cy.get("[data-testid='checkbox-Authentication Data'] > span").should( - "have.attr", - "data-checked", - ); - // parent should be indeterminate since not all children are checked - cy.get("[data-testid='checkbox-System Data'] > span").should( - "have.attr", - "data-indeterminate", - ); - // now select all children - cy.getByTestId("checkbox-Operations Data").click(); - // parent should be checked since all children are checked - cy.get("[data-testid='checkbox-System Data'] > span").should( - "have.attr", - "data-checked", - ); - // the children of selected parents should be disabled - 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.authorization", - ]; - expectedSelected.forEach((e) => { - cy.getByTestId("selected-categories").should("contain", e); - }); - }); - - it("Should be able to clear selected", () => { - cy.visit("/dataset/demo_users_dataset"); - cy.getByTestId("row-5-col-actions").find("button").click(); - cy.getByTestId("data-category-dropdown").click(); - cy.getByTestId("checkbox-System Data").click(); - cy.get("[data-testid='checkbox-System Data'] > span").should( - "have.attr", - "data-checked", - ); - cy.getByTestId("data-category-done-btn").click(); - cy.getByTestId("selected-categories").should( - "contain", - "user.unique_id", - ); - cy.getByTestId("selected-categories").should("contain", "system"); - cy.getByTestId("data-category-dropdown").click(); - cy.getByTestId("data-category-clear-btn").click(); - cy.get("[data-testid='checkbox-System Data'] > span").should( - "not.have.attr", - "data-checked", - ); - cy.getByTestId("data-category-done-btn").click(); - cy.getByTestId("selected-categories").should( - "not.contain", - "user.unique_id", - ); - }); - }); }); describe("Creating datasets", () => {