Skip to content

Commit

Permalink
Fix setting data-cy
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr committed Jul 19, 2024
1 parent 37ed5e9 commit 6888e40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/client/src/commons/menu/mainView/mainSideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,22 @@ const MainSideNav = ({
}}>
{activeFilterCount > 0 && <Badge color="error" sx={{ margin: "1px" }} badgeContent={activeFilterCount}></Badge>}
<NavButton
key="show-filter-button"
data-cy="show-filter-button"
icon={<FilterIcon />}
label={t("searchfilters")}
selected={isFilterPanelVisible}
onClick={handleToggleFilter}
/>
<NavButton
key="new-borehole-button"
data-cy="new-borehole-button"
icon={<AddIcon />}
label={t("add")}
selected={isAddPanelVisible}
disabled={user.data.roles.indexOf("EDIT") === -1}
onClick={handleToggleAdd}
/>
<NavButton
key="import-borehole-button"
data-cy="import-borehole-button"
icon={<UploadIcon />}
label={t("upload")}
disabled={user.data.roles.indexOf("EDIT") === -1}
Expand All @@ -127,7 +127,7 @@ const MainSideNav = ({
}}
/>
<NavButton
key="layers-button"
data-cy="layers-button"
icon={<LayersIcon />}
label={t("usersMap")}
selected={isLayersPanelVisible}
Expand All @@ -140,13 +140,13 @@ const MainSideNav = ({
padding: "1em",
}}>
<NavButton
key="settings-button"
data-cy="settings-button"
icon={<SettingsIcon />}
label={t("header_settings")}
onClick={() => history.push(`/setting`)}
/>
<NavButton
key="help-button"
data-cy="help-button"
icon={<HelpIcon />}
label={t("header_help")}
onClick={() => window.open(`/help`)}
Expand Down
6 changes: 2 additions & 4 deletions src/client/src/components/buttons/navButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { IconButton, Stack, Typography } from "@mui/material";
import { theme } from "../../AppTheme";

export interface NavButtonProps extends ButtonProps {
key: string;
label: string;
icon: JSX.Element;
selected?: boolean;
}

Expand All @@ -20,13 +21,10 @@ export const NavButton = forwardRef<HTMLButtonElement, NavButtonProps>((props, r
{props.icon} <Typography>{props.label}</Typography>
</>
);

return (
<IconButton
ref={ref}
{...props}
key={props.key}
data-cy={props.key}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
sx={{
Expand Down

0 comments on commit 6888e40

Please sign in to comment.