Skip to content

Commit

Permalink
pull latest
Browse files Browse the repository at this point in the history
  • Loading branch information
eastandwestwind committed Jan 10, 2025
2 parents 8968a9d + a583252 commit 908bbaa
Show file tree
Hide file tree
Showing 38 changed files with 1,169 additions and 96 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
## [Unreleased](https://github.com/ethyca/fides/compare/2.52.0...main)

### Added
- Added Action Center MVP behind new feature flag [#5622](https://github.com/ethyca/fides/pull/5622)
- Added cache-clearing methods to the `DBCache` model to allow deleting cache entries [#5629](https://github.com/ethyca/fides/pull/5629)
- Adds partitioning, custom identities, multiple identities to test coverage for BigQuery Enterprise [#5618](https://github.com/ethyca/fides/pull/5618)

### Fixed
- Fixed issue where the custom report "reset" button was not working as expected [#5649](https://github.com/ethyca/fides/pull/5649)
- Fixed column ordering issue in the Data Map report [#5649](https://github.com/ethyca/fides/pull/5649)
- Fixed issue where the Data Map report filter dialog was missing an Accordion item label [#5649](https://github.com/ethyca/fides/pull/5649)

## [2.52.0](https://github.com/ethyca/fides/compare/2.51.2...2.52.0)

Expand Down
175 changes: 175 additions & 0 deletions clients/admin-ui/cypress/e2e/action-center.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import { stubActionCenter, stubPlus } from "cypress/support/stubs";

import {
ACTION_CENTER_ROUTE,
INTEGRATION_MANAGEMENT_ROUTE,
} from "~/features/common/nav/v2/routes";

describe("Action center", () => {
beforeEach(() => {
cy.login();
stubPlus(true);
stubActionCenter();
});

describe("disabled web monitor", () => {
beforeEach(() => {
cy.intercept("GET", "/api/v1/config*", {
body: {
detection_discovery: {
website_monitor_enabled: false,
},
},
}).as("getTranslationConfig");
cy.visit(ACTION_CENTER_ROUTE);
});
it("should display a message that the web monitor is disabled", () => {
cy.wait("@getTranslationConfig");
cy.contains("currently disabled").should("exist");
});
});

describe("empty action center", () => {
beforeEach(() => {
cy.intercept("GET", "/api/v1/plus/discovery-monitor/aggregate-results*", {
fixture: "empty-pagination.json",
}).as("getMonitorResults");
cy.visit(ACTION_CENTER_ROUTE);
});
it("should display empty state", () => {
cy.wait("@getMonitorResults");
cy.get("[data-testid='search-bar']").should("exist");
cy.get(`[class*='ant-empty'] [class*='ant-empty-image']`).should("exist");
cy.get(
`[class*='ant-empty'] a[href="${INTEGRATION_MANAGEMENT_ROUTE}"]`,
).should("exist");
});
});

describe("Action center monitor aggregate results", () => {
const webMonitorKey = "my_web_monitor_2";
const integrationMonitorKey = "My_New_BQ_Monitor";
beforeEach(() => {
cy.visit(ACTION_CENTER_ROUTE);
});
it("should render the current monitor results", () => {
cy.get("[data-testid='Action center']").should("exist");
cy.wait("@getMonitorResults");
cy.get("[data-testid*='monitor-result-']").should("have.length", 3);
cy.get("[data-testid^='monitor-result-']").each((result) => {
const monitorKey = result
.attr("data-testid")
.replace("monitor-result-", "");
// linked title
cy.wrap(result)
.contains("assets detected")
.should("have.attr", "href", `${ACTION_CENTER_ROUTE}/${monitorKey}`);
// last monitored relative date with real date in tooltip
cy.wrap(result)
.find("[data-testid='monitor-date']")
.contains(" ago")
.realHover();
cy.get(".ant-tooltip-inner").should("contain", "December");
});
// description
cy.getByTestId(`monitor-result-${webMonitorKey}`).should(
"contain",
"92 Browser Requests, 5 Cookies detected.",
);
// monitor name
cy.getByTestId(`monitor-result-${webMonitorKey}`).should(
"contain",
"my web monitor 2",
);
});
it("should have appropriate actions for web monitors", () => {
cy.wait("@getMonitorResults");
// Add button
// TODO: [HJ-337] uncomment when Add button is implemented
// cy.getByTestId(`add-button-${webMonitorKey}`).should("exist");
// Review button
cy.getByTestId(`review-button-${webMonitorKey}`).should(
"have.attr",
"href",
`${ACTION_CENTER_ROUTE}/${webMonitorKey}`,
);
});
it.skip("Should have appropriate actions for Integrations monitors", () => {
cy.wait("@getMonitorResults");
// Classify button
cy.getByTestId(`review-button-${integrationMonitorKey}`).should(
"have.attr",
"href",
`${ACTION_CENTER_ROUTE}/${integrationMonitorKey}`,
);
// Ignore button
cy.getByTestId(`ignore-button-${integrationMonitorKey}`).should("exist");
});
it.skip("Should have appropriate actions for SSO monitors", () => {
cy.wait("@getMonitorResults");
// Add button
cy.getByTestId(`add-button-${webMonitorKey}`).should("exist");
// Ignore button
cy.getByTestId(`ignore-button-${webMonitorKey}`).should("exist");
});
it.skip("Should paginate results", () => {
// TODO: mock pagination and also test skeleton loading state
});
});

describe("Action center system aggregate results", () => {
const webMonitorKey = "my_web_monitor_1";
beforeEach(() => {
cy.visit(`${ACTION_CENTER_ROUTE}/${webMonitorKey}`);
});
it("should display a breadcrumb", () => {
cy.getByTestId("page-breadcrumb").within(() => {
cy.get("a.ant-breadcrumb-link")
.should("contain", "All activity")
.should("have.attr", "href", ACTION_CENTER_ROUTE);
cy.contains("my_web_monitor_1").should("exist");
});
});
it("should render the aggregated system results in a table", () => {
cy.wait("@getSystemAggregateResults");
cy.getByTestId("column-system_name").should("exist");
cy.getByTestId("column-total_updates").should("exist");
cy.getByTestId("column-data_use").should("exist");
cy.getByTestId("column-locations").should("exist");
cy.getByTestId("column-domains").should("exist");
cy.getByTestId("column-actions").should("exist");
cy.getByTestId("search-bar").should("exist");
cy.getByTestId("pagination-btn").should("exist");
cy.getByTestId("row-0-col-system_name").within(() => {
cy.getByTestId("change-icon").should("exist"); // new result
cy.contains("Uncategorized assets").should("exist");
});
// data use column should be empty for uncategorized assets
cy.getByTestId("row-0-col-data_use").children().should("have.length", 0);
cy.getByTestId("row-1-col-system_name").within(() => {
cy.getByTestId("change-icon").should("not.exist"); // existing result
cy.contains("Google Tag Manager").should("exist");
});
// TODO: data use column should not be empty for other assets
// cy.getByTestId("row-1-col-data_use").children().should("not.have.length", 0);

// multiple locations
cy.getByTestId("row-2-col-locations").should("contain", "2 locations");
// single location
cy.getByTestId("row-3-col-locations").should("contain", "USA");

// multiple domains
cy.getByTestId("row-0-col-domains").should("contain", "29 domains");
// single domain
cy.getByTestId("row-3-col-domains").should(
"contain",
"analytics.google.com",
);
});
// it("should navigate to table view on row click", () => {
// cy.getByTestId("row-1").click();
// cy.url().should("contain", "fds.1046");
// cy.getByTestId("page-breadcrumb").should("contain", "fds.1046");
// });
});
});
44 changes: 40 additions & 4 deletions clients/admin-ui/cypress/e2e/datamap-report.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@ describe("Data map report table", () => {
it("should filter the table by making a selection", () => {
cy.getByTestId("filter-multiple-systems-btn").click();
cy.getByTestId("datamap-report-filter-modal").should("be.visible");
cy.getByTestId("filter-modal-accordion-button")
.eq(0)
.should("have.text", "Data use");
cy.getByTestId("filter-modal-accordion-button")
.eq(1)
.should("have.text", "Data categories");
cy.getByTestId("filter-modal-accordion-button")
.eq(2)
.should("have.text", "Data subject");
cy.getByTestId("filter-modal-accordion-button").eq(1).click();
cy.getByTestId("filter-modal-checkbox-tree-categories").should(
"be.visible",
Expand Down Expand Up @@ -389,14 +398,15 @@ describe("Data map report table", () => {
cy.get("#toast-datamap-report-toast")
.should("be.visible")
.should("have.attr", "data-status", "success");
cy.getByTestId("custom-reports-trigger")
.should("contain.text", "My Custom Report")
.click();
cy.getByTestId("custom-reports-trigger").should(
"contain.text",
"My Custom Report",
);
cy.getByTestId("fidesTable").within(() => {
// reordering applied to report
cy.get("thead th").eq(2).should("contain.text", "Legal name");
// column visibility applied to report
cy.get("thead th").eq(4).should("not.contain.text", "Data subject");
cy.getByTestId("column-data_subjects").should("not.exist");
});
cy.getByTestId("group-by-menu").should(
"contain.text",
Expand Down Expand Up @@ -442,10 +452,36 @@ describe("Data map report table", () => {
cy.getByTestId("custom-reports-reset-button").click();
cy.getByTestId("apply-report-button").click();
cy.getByTestId("custom-reports-popover").should("not.be.visible");

cy.getByTestId("custom-reports-trigger").should(
"contain.text",
"Reports",
);
cy.getByTestId("fidesTable").within(() => {
// reordering reverted
cy.get("thead th").eq(2).should("contain.text", "Data categories");
// column visibility restored
cy.getByTestId("column-data_subjects").should("exist");
});
cy.getByTestId("group-by-menu").should("contain.text", "Group by system");
cy.getByTestId("more-menu").click();
cy.getByTestId("edit-columns-btn").click();
cy.get("button#data_subjects").should(
"have.attr",
"aria-checked",
"true",
);
cy.getByTestId("column-settings-close-button").click();
cy.getByTestId("filter-multiple-systems-btn").click();
cy.getByTestId("datamap-report-filter-modal")
.should("be.visible")
.within(() => {
cy.getByTestId("filter-modal-accordion-button").eq(0).click();
cy.getByTestId("checkbox-Analytics").within(() => {
cy.get("[data-checked]").should("not.exist");
});
cy.getByTestId("standard-dialog-close-btn").click();
});
});
it("should allow the user cancel a report selection", () => {
cy.wait("@getCustomReportsMinimal");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"items": [
{
"name": "my web monitor 2",
"key": "my_web_monitor_2",
"last_monitored": "2024-12-17T17:31:20.791014Z",
"updates": {
"Browser Request": 92,
"Cookie": 5
},
"total_updates": 97
},
{
"name": "my web monitor 1",
"key": "my_web_monitor_1",
"last_monitored": "2024-12-17T17:31:02.319068Z",
"updates": {
"Browser Request": 201,
"Cookie": 24
},
"total_updates": 225
},
{
"name": "My New BQ Monitor",
"key": "My_New_BQ_Monitor",
"last_monitored": "2024-12-16T20:04:16.824025Z",
"updates": {
"Database": 2,
"Field": 216,
"Schema": 13,
"Table": 22
},
"total_updates": 253
}
],
"total": 3,
"page": 1,
"size": 25,
"pages": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"items": [
{
"id": null,
"name": null,
"system_key": null,
"vendor_id": null,
"total_updates": 108,
"locations": ["USA"],
"domains": [
"alb.reddit.com",
"api.hubapi.com",
"app.revenuehero.io",
".ethyca.com",
"ethyca.com",
"ethyca.fides-cdn.ethyca.com",
"forms.hscollectedforms.net",
"forms.hubspot.com",
"forms-na1.hsforms.com",
"googleads.g.doubleclick.net",
".hsadspixel.net",
".hsforms.com",
".hs-scripts.com",
".hubspot.com",
"js.hsadspixel.net",
"js.hs-analytics.net",
"js.hs-banner.com",
"js.hscollectedforms.net",
"js.hs-scripts.com",
"kit.fontawesome.com",
".linkedin.com",
"pixel-config.reddit.com",
"px.ads.linkedin.com",
"snap.licdn.com",
"stats.g.doubleclick.net",
"track.hubspot.com",
"www.clickcease.com",
".www.linkedin.com",
"www.redditstatic.com"
]
},
{
"id": "system_key-72649f03-7a30-4758-9772-e74fca3b6788",
"name": "Google Tag Manager",
"system_key": "system_key-72649f03-7a30-4758-9772-e74fca3b6788",
"vendor_id": "fds.1046",
"total_updates": 10,
"locations": ["USA"],
"domains": [
"td.doubleclick.net",
"www.google.com",
"www.googletagmanager.com"
]
},
{
"id": "system_key-652c8984-ade7-470b-bce4-7e184621be9d",
"name": "Hubspot",
"system_key": "system_key-652c8984-ade7-470b-bce4-7e184621be9d",
"vendor_id": "fds.1053",
"total_updates": 6,
"locations": ["USA", "Canada"],
"domains": [
"forms.hsforms.com",
".hs-analytics.net",
".hs-banner.com",
".hsforms.net",
"js.hsforms.net"
]
},
{
"id": "fds.1047",
"name": "Google Analytics",
"system_key": null,
"vendor_id": "fds.1047",
"total_updates": 1,
"locations": ["USA"],
"domains": ["analytics.google.com"]
}
],
"total": 4,
"page": 1,
"size": 25,
"pages": 1
}
Loading

0 comments on commit 908bbaa

Please sign in to comment.