1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-03 04:45:21 +02:00

chore(sidebar): add data-cys [EE-3605] (#7143)

* chore(sidebar): add data-cys [EE-3605]

fix [EE-3605]
This commit is contained in:
Chaim Lev-Ari 2022-06-28 19:36:40 +03:00 committed by GitHub
parent ed8f9b5931
commit 882051cc30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 158 additions and 25 deletions

View file

@ -6,12 +6,17 @@ import {
import clsx from 'clsx';
import { ComponentProps } from 'react';
import { AutomationTestingProps } from '@/types';
import { Link } from '@@/Link';
import { IconProps, Icon } from '@@/Icon';
import { useSidebarState } from '../useSidebarState';
interface Props extends IconProps, ComponentProps<typeof Link> {
interface Props
extends IconProps,
ComponentProps<typeof Link>,
AutomationTestingProps {
label: string;
ignorePaths?: string[];
}
@ -23,6 +28,7 @@ export function Head({
label,
icon,
ignorePaths = [],
'data-cy': dataCy,
}: Props) {
const { isOpen } = useSidebarState();
const anchorProps = useSrefActive(
@ -43,6 +49,7 @@ export function Head({
'text-inherit no-underline hover:no-underline hover:text-inherit focus:no-underline focus:text-inherit w-full flex-1 rounded-md',
{ 'px-3': isOpen }
)}
data-cy={dataCy}
>
<div
className={clsx('flex items-center h-8 space-x-4 text-sm', {