Skip to content

Commit

Permalink
Add test id for scan history
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-deepfence committed Jul 29, 2024
1 parent be9c6fe commit 906381d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const ScanHistoryDropdown = ({
scan.onDownloadClick(scan.id);
setOpen(false);
}}
data-testid="menuDownloadIconId"
/>
<IconButton
variant="flat"
Expand All @@ -97,6 +98,7 @@ export const ScanHistoryDropdown = ({
scan.onDeleteClick(scan.id);
setOpen(false);
}}
data-testid="menuDeleteIconId"
/>

<IconButton
Expand All @@ -116,6 +118,7 @@ export const ScanHistoryDropdown = ({
scan?.onScanTimeCompareButtonClick?.(scan.timestamp);
setOpen(false);
}}
data-testid="menuCompareIconId"
/>
</div>
</div>
Expand All @@ -125,7 +128,10 @@ export const ScanHistoryDropdown = ({
</>
}
>
<span className="text-h5 flex items-center text-text-input-value gap-x-2">
<span
className="text-h5 flex items-center text-text-input-value gap-x-2"
data-testid="scanHistoryDropdownId"
>
{currentTimeStamp}
<div className="h-4 w-4 text-accent-accent">
<CaretDown />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ const HistoryControls = () => {
nodeType: nodeType as UtilsReportFiltersNodeTypeEnum,
});
}}
data-testid="downloadScanButtonId"
>
Download
</Button>
Expand All @@ -236,6 +237,7 @@ const HistoryControls = () => {
}
disabled={fetchStatus !== 'idle'}
onClick={() => setScanIdToDelete(scan_id ?? '')}
data-testid="deleteScanButtonId"
>
Delete
</Button>
Expand All @@ -256,6 +258,7 @@ const HistoryControls = () => {
showScanTimeModal: true,
});
}}
data-testid="compareScanButtonId"
>
Compare scan
</Button>
Expand Down

0 comments on commit 906381d

Please sign in to comment.