mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
chore(data-cy): require data-cy attributes [EE-6880] (#11453)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
3cad13388c
commit
d38085a560
538 changed files with 2571 additions and 595 deletions
|
@ -28,6 +28,7 @@ function Example({ title }: Args) {
|
|||
value={value}
|
||||
title={title}
|
||||
inputId="file-field"
|
||||
data-cy="file-upload-field"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ test('render should make the file button clickable and fire onChange event after
|
|||
const { findByText, findByLabelText } = render(
|
||||
<FileUploadField
|
||||
title="test button"
|
||||
data-cy="file-input"
|
||||
onChange={onClick}
|
||||
inputId="file-field"
|
||||
/>
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { ChangeEvent, ComponentProps, createRef } from 'react';
|
||||
import { Upload, XCircle } from 'lucide-react';
|
||||
|
||||
import { AutomationTestingProps } from '@/types';
|
||||
|
||||
import { Button } from '@@/buttons';
|
||||
import { Icon } from '@@/Icon';
|
||||
|
||||
import styles from './FileUploadField.module.css';
|
||||
|
||||
export interface Props {
|
||||
export interface Props extends AutomationTestingProps {
|
||||
onChange(value: File): void;
|
||||
value?: File | null;
|
||||
accept?: string;
|
||||
|
@ -26,6 +28,7 @@ export function FileUploadField({
|
|||
inputId,
|
||||
color = 'primary',
|
||||
name,
|
||||
'data-cy': dataCy,
|
||||
}: Props) {
|
||||
const fileRef = createRef<HTMLInputElement>();
|
||||
|
||||
|
@ -47,6 +50,7 @@ export function FileUploadField({
|
|||
color={color}
|
||||
onClick={handleButtonClick}
|
||||
className={styles.fileButton}
|
||||
data-cy={dataCy}
|
||||
icon={Upload}
|
||||
>
|
||||
{title}
|
||||
|
|
|
@ -31,6 +31,7 @@ function Example({ title }: Args) {
|
|||
description={
|
||||
<span>You can upload a Compose file from your computer.</span>
|
||||
}
|
||||
data-cy="file-upload-form"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -9,6 +9,7 @@ test('render should include description', async () => {
|
|||
title="test button"
|
||||
onChange={onClick}
|
||||
description={<span>test description</span>}
|
||||
data-cy="test"
|
||||
/>
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { PropsWithChildren, ReactNode } from 'react';
|
||||
|
||||
import { AutomationTestingProps } from '@/types';
|
||||
|
||||
import { FormSectionTitle } from '@@/form-components/FormSectionTitle';
|
||||
import { FileUploadField } from '@@/form-components/FileUpload/FileUploadField';
|
||||
|
||||
|
@ -17,7 +19,8 @@ export function FileUploadForm({
|
|||
title = 'Select a file',
|
||||
required = false,
|
||||
description,
|
||||
}: PropsWithChildren<Props>) {
|
||||
'data-cy': dataCy,
|
||||
}: PropsWithChildren<Props> & AutomationTestingProps) {
|
||||
return (
|
||||
<div className="file-upload-form">
|
||||
<FormSectionTitle>Upload</FormSectionTitle>
|
||||
|
@ -28,6 +31,7 @@ export function FileUploadForm({
|
|||
<div className="col-sm-12">
|
||||
<FileUploadField
|
||||
inputId="file-upload-field"
|
||||
data-cy={dataCy}
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
title={title}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue