Skip to content

Commit

Permalink
Update button and data test id
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-deepfence committed Jul 23, 2024
1 parent d6222e3 commit e539a16
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ const ScanResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ const MalwareScans = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ const MostExploitableMalwares = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ const UniqueMalwares = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const CloudPostureResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const CloudPostureResultsGrouped = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ const Accounts = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ const PostureResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ const RegistryImagesTagsResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ const MostExploitableSecrets = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ const ScanResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ const SecretScans = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const UniqueSecrets = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const CloudResourcesTable = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const ContainersTable = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const HostsTable = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const KubernetesTable = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const PodsTable = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ const MostExploitableVulnerabilities = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const RuntimeBom = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ const UniqueVulnerabilities = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ const CVEResults = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ const VulnerabilityScans = () => {
onClick={() => {
setFiltersExpanded((prev) => !prev);
}}
id="filterTable"
data-testid="filterButtonIdForTable"
>
Filter
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe(`Component Button`, () => {
const { getByTestId } = renderUI(
<Button
id="id"
data-testid="button-id"
color="default"
startIcon={<Plus />}
endIcon={<Plus />}
Expand All @@ -39,6 +40,7 @@ describe(`Component Button`, () => {
const { getByTestId, getByText } = renderUI(
<Button
id="id"
data-testid="button-id"
color="default"
startIcon={<Plus />}
endIcon={<Plus />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
<button
ref={ref}
id={_id}
data-testid={`button-${_id}`}
disabled={disabled}
className={cn(
buttonCva({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ describe(`Component Modal`, () => {

return (
<>
<Button onClick={() => setOpen(true)} id="trigger-id" ref={ref}>
<Button
onClick={() => setOpen(true)}
id="trigger-id"
data-testid="button-trigger-id"
ref={ref}
>
Click to open
</Button>
<Modal
Expand Down Expand Up @@ -79,7 +84,12 @@ describe(`Component Modal`, () => {

return (
<>
<Button onClick={() => setOpen(true)} id="trigger-id" ref={ref}>
<Button
onClick={() => setOpen(true)}
id="trigger-id"
data-testid="button-trigger-id"
ref={ref}
>
Click to open
</Button>
<Modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ describe(`Component SlidingModal`, () => {
return (
<>
<div className="some-test">
<Button onClick={() => setOpen(true)} id="trigger-id" ref={ref}>
<Button
onClick={() => setOpen(true)}
id="trigger-id"
data-testid="button-trigger-id"
ref={ref}
>
Click to open
</Button>
</div>
Expand Down Expand Up @@ -81,7 +86,12 @@ describe(`Component SlidingModal`, () => {

return (
<>
<Button onClick={() => setOpen(true)} id="trigger-id" ref={ref}>
<Button
onClick={() => setOpen(true)}
id="trigger-id"
data-testid="button-trigger-id"
ref={ref}
>
Click to open
</Button>
<SlidingModal
Expand Down

0 comments on commit e539a16

Please sign in to comment.