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:
parent
ed8f9b5931
commit
882051cc30
10 changed files with 158 additions and 25 deletions
|
@ -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', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue