1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(kube): add a11y props for smoke tests [EE-6747] (#11263)

This commit is contained in:
Chaim Lev-Ari 2024-02-29 09:26:13 +02:00 committed by GitHub
parent 42c2a52a6b
commit 6c70049ecc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 143 additions and 62 deletions

View file

@ -17,6 +17,7 @@ export interface Props {
dataCy?: string;
// true if you want to always show the tooltip
visibleTooltip?: boolean;
disabled?: boolean;
}
export function Slider({
@ -27,6 +28,7 @@ export function Slider({
onChange,
dataCy,
visibleTooltip: visible,
disabled,
}: Props) {
const marks = {
[min]: visible && value / max < 0.1 ? '' : translateMinValue(min),
@ -34,14 +36,14 @@ export function Slider({
};
return (
<div className={styles.root}>
<div className={styles.root} data-cy={dataCy}>
<RcSlider
handleRender={visible ? sliderTooltip : undefined}
min={min}
max={max}
marks={marks}
step={step}
data-cy={dataCy}
disabled={disabled}
value={value}
onChange={onChange}
/>

View file

@ -10,6 +10,7 @@ export function SliderWithInput({
step = 1,
dataCy,
visibleTooltip = false,
inputId,
}: {
value: number;
onChange: (value: number) => void;
@ -18,6 +19,7 @@ export function SliderWithInput({
dataCy: string;
step?: number;
visibleTooltip?: boolean;
inputId?: string;
}) {
return (
<div className="flex items-center gap-6">
@ -44,6 +46,7 @@ export function SliderWithInput({
onChange={(e) => onChange(e.target.valueAsNumber)}
className="w-32"
data-cy={`${dataCy}Input`}
id={inputId}
/>
</div>
);