mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(kube): add a11y props for smoke tests [EE-6747] (#11263)
This commit is contained in:
parent
42c2a52a6b
commit
6c70049ecc
26 changed files with 143 additions and 62 deletions
|
@ -2,6 +2,7 @@ import clsx from 'clsx';
|
|||
|
||||
import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service';
|
||||
import { FeatureId } from '@/react/portainer/feature-flags/enums';
|
||||
import { AutomationTestingProps } from '@/types';
|
||||
|
||||
import { BEFeatureIndicator } from '@@/BEFeatureIndicator';
|
||||
|
||||
|
@ -9,7 +10,7 @@ import './Switch.css';
|
|||
|
||||
import styles from './Switch.module.css';
|
||||
|
||||
export interface Props {
|
||||
export interface Props extends AutomationTestingProps {
|
||||
checked: boolean;
|
||||
id: string;
|
||||
name: string;
|
||||
|
@ -17,7 +18,6 @@ export interface Props {
|
|||
|
||||
index?: number;
|
||||
className?: string;
|
||||
dataCy?: string;
|
||||
disabled?: boolean;
|
||||
featureId?: FeatureId;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function Switch({
|
|||
checked,
|
||||
id,
|
||||
disabled,
|
||||
dataCy,
|
||||
'data-cy': dataCy,
|
||||
onChange,
|
||||
index,
|
||||
featureId,
|
||||
|
@ -42,6 +42,8 @@ export function Switch({
|
|||
business: limitedToBE,
|
||||
limited: limitedToBE,
|
||||
})}
|
||||
data-cy={dataCy}
|
||||
aria-checked={checked}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
|
@ -51,7 +53,7 @@ export function Switch({
|
|||
disabled={disabled || limitedToBE}
|
||||
onChange={({ target: { checked } }) => onChange(checked, index)}
|
||||
/>
|
||||
<span className="slider round before:content-['']" data-cy={dataCy} />
|
||||
<span className="slider round before:content-['']" />
|
||||
</label>
|
||||
{limitedToBE && <BEFeatureIndicator featureId={featureId} />}
|
||||
</>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue