From e539a16ee04d6fd656e0ffce8ca280a9b832c999 Mon Sep 17 00:00:00 2001 From: milan-deepfence Date: Tue, 23 Jul 2024 23:56:48 +0530 Subject: [PATCH] Update button and data test id --- .../features/malwares/pages/MalwareScanResults.tsx | 2 +- .../src/features/malwares/pages/MalwareScans.tsx | 2 +- .../malwares/pages/MostExploitableMalwares.tsx | 2 +- .../src/features/malwares/pages/UniqueMalwares.tsx | 2 +- .../scan-result/cloud/CloudPostureResults.tsx | 2 +- .../cloud/CloudPostureResultsGrouped.tsx | 2 +- .../src/features/postures/pages/Accounts.tsx | 2 +- .../features/postures/pages/PostureScanResults.tsx | 2 +- .../registries/pages/RegistryImageTags.tsx | 2 +- .../secrets/pages/MostExploitableSecrets.tsx | 2 +- .../features/secrets/pages/SecretScanResults.tsx | 2 +- .../src/features/secrets/pages/SecretScans.tsx | 2 +- .../src/features/secrets/pages/UniqueSecrets.tsx | 2 +- .../data-components/tables/CloudResourcesTable.tsx | 2 +- .../data-components/tables/ContainersTable.tsx | 2 +- .../topology/data-components/tables/HostsTable.tsx | 2 +- .../data-components/tables/KubernetesTable.tsx | 2 +- .../topology/data-components/tables/PodsTable.tsx | 2 +- .../pages/MostExploitableVulnerabilities.tsx | 2 +- .../features/vulnerabilities/pages/RuntimeBom.tsx | 2 +- .../pages/UniqueVulnerabilities.tsx | 2 +- .../pages/VulnerabilityScanResults.tsx | 2 +- .../vulnerabilities/pages/VulnerabilityScans.tsx | 2 +- .../src/components/button/Button.test.tsx | 2 ++ .../ui-components/src/components/button/Button.tsx | 1 - .../src/components/modal/Modal.test.tsx | 14 ++++++++++++-- .../src/components/modal/SlidingModal.test.tsx | 14 ++++++++++++-- 27 files changed, 49 insertions(+), 28 deletions(-) diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx index 5ebe964297..a54995d1ee 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx @@ -1760,7 +1760,7 @@ const ScanResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx index d619fb22ea..fffb153710 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx @@ -1313,7 +1313,7 @@ const MalwareScans = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MostExploitableMalwares.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MostExploitableMalwares.tsx index c15db7957c..660620d559 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MostExploitableMalwares.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MostExploitableMalwares.tsx @@ -455,7 +455,7 @@ const MostExploitableMalwares = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx index 6829f1d28e..4a35fdc0d8 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx @@ -490,7 +490,7 @@ const UniqueMalwares = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx index e78843875f..9f2e5e84da 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx @@ -94,7 +94,7 @@ export const CloudPostureResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx index 88e6db4286..684e849895 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx @@ -76,7 +76,7 @@ export const CloudPostureResultsGrouped = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx index 474b50c8af..63afe55129 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx @@ -1813,7 +1813,7 @@ const Accounts = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx index 5c56d2f260..8c8bdcaf61 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx @@ -1305,7 +1305,7 @@ const PostureResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx b/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx index d169c2b434..4be5bd1bd7 100644 --- a/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx @@ -483,7 +483,7 @@ const RegistryImagesTagsResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/MostExploitableSecrets.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/MostExploitableSecrets.tsx index 4cd60356fc..2f78aedfe4 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/MostExploitableSecrets.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/MostExploitableSecrets.tsx @@ -436,7 +436,7 @@ const MostExploitableSecrets = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx index a7e11a9054..e2363fa8f0 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx @@ -1737,7 +1737,7 @@ const ScanResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx index b20c7c908f..084b4dd920 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx @@ -1308,7 +1308,7 @@ const SecretScans = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx index 04c56839de..d0126eafa8 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx @@ -475,7 +475,7 @@ const UniqueSecrets = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx index 2afc6a4bb2..aa34199245 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx @@ -78,7 +78,7 @@ export const CloudResourcesTable = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx index ca7cc11ea8..b82b097cd1 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx @@ -85,7 +85,7 @@ export const ContainersTable = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx index 605c0b0703..56351cb3cd 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx @@ -99,7 +99,7 @@ export const HostsTable = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx index a0777c3f4d..53c9bfc7e7 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx @@ -203,7 +203,7 @@ export const KubernetesTable = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx index 26e2450eb5..869249f046 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx @@ -84,7 +84,7 @@ export const PodsTable = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/MostExploitableVulnerabilities.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/MostExploitableVulnerabilities.tsx index 2bdcee314a..33be771e86 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/MostExploitableVulnerabilities.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/MostExploitableVulnerabilities.tsx @@ -690,7 +690,7 @@ const MostExploitableVulnerabilities = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx index 224362d19c..940dac3fd6 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx @@ -105,7 +105,7 @@ const RuntimeBom = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx index 62fde86154..2279b99843 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx @@ -600,7 +600,7 @@ const UniqueVulnerabilities = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx index a8a3b94ddb..3ee4cd541b 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx @@ -1685,7 +1685,7 @@ const CVEResults = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx index 311d4d0492..c7f1f3eb65 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx @@ -1369,7 +1369,7 @@ const VulnerabilityScans = () => { onClick={() => { setFiltersExpanded((prev) => !prev); }} - id="filterTable" + data-testid="filterButtonIdForTable" > Filter diff --git a/deepfence_frontend/packages/ui-components/src/components/button/Button.test.tsx b/deepfence_frontend/packages/ui-components/src/components/button/Button.test.tsx index cf01d1e670..9580681087 100644 --- a/deepfence_frontend/packages/ui-components/src/components/button/Button.test.tsx +++ b/deepfence_frontend/packages/ui-components/src/components/button/Button.test.tsx @@ -18,6 +18,7 @@ describe(`Component Button`, () => { const { getByTestId } = renderUI( { return ( <> - { return ( <>
-
@@ -81,7 +86,12 @@ describe(`Component SlidingModal`, () => { return ( <> -