diff --git a/tdrive/frontend/src/app/atoms/avatar/index.tsx b/tdrive/frontend/src/app/atoms/avatar/index.tsx index 961370e9..a6b554fc 100644 --- a/tdrive/frontend/src/app/atoms/avatar/index.tsx +++ b/tdrive/frontend/src/app/atoms/avatar/index.tsx @@ -40,7 +40,8 @@ export default function Avatar(props: AvatarProps) { const fontSize = fontSizes[props.size || 'md']; const addedClassName = props.className || ''; const avatarTitle = props.title || ''; - const restProps = _.omit(props, 'size', 'type', 'avatar', 'title', 'className', 'icon'); + const testClassId = props.testClassId; + const restProps = _.omit(props, 'size', 'type', 'avatar', 'title', 'className', 'icon', 'testClassId'); let className = `w-${avatarSize} h-${avatarSize} ${ avatarType === 'circle' ? 'rounded-full' : 'rounded-sm' @@ -65,17 +66,19 @@ export default function Avatar(props: AvatarProps) { ? {} : { backgroundImage: `url('${getGradient(props.title || '')}')` }; + const testId = testClassId ? `testid:${testClassId}` : '' + if (props.icon) { className += ' '; return (
{props.icon} @@ -85,18 +88,18 @@ export default function Avatar(props: AvatarProps) { if (props.avatar) { return ( -
+
{props.title}
); } return ( -
+
{letters.toUpperCase()}
); diff --git a/tdrive/frontend/src/app/atoms/input/input-checkbox.tsx b/tdrive/frontend/src/app/atoms/input/input-checkbox.tsx index 102639d7..b019b618 100644 --- a/tdrive/frontend/src/app/atoms/input/input-checkbox.tsx +++ b/tdrive/frontend/src/app/atoms/input/input-checkbox.tsx @@ -8,10 +8,13 @@ export const Checkbox = (props: { value?: boolean; className?: string; disabled?: boolean; + testClassId?: string; }) => { const renderSwitch = () => { const className = props.className || ''; + const testId = props.testClassId ? `testid:${props.testClassId}` : ''; + return (
!props.label && !props.disabled && props.onChange && props.onChange(!props.value) diff --git a/tdrive/frontend/src/app/atoms/loader/index.tsx b/tdrive/frontend/src/app/atoms/loader/index.tsx index a2692306..d3dfd63b 100644 --- a/tdrive/frontend/src/app/atoms/loader/index.tsx +++ b/tdrive/frontend/src/app/atoms/loader/index.tsx @@ -1,7 +1,7 @@ export const Loader = (props: { className?: string }) => { return ( { }; } return <> - + { className="ml-2" theme={props.buttonOkTheme || "danger"} onClick={dialogCloseHandler(true)} - testClassId="confirm-modal-button-confirm" + testClassId="button-confirm" > {Languages.t(props.buttonOkLabel)} diff --git a/tdrive/frontend/src/app/components/banner/banner.tsx b/tdrive/frontend/src/app/components/banner/banner.tsx index 49f711f6..db775619 100644 --- a/tdrive/frontend/src/app/components/banner/banner.tsx +++ b/tdrive/frontend/src/app/components/banner/banner.tsx @@ -15,6 +15,7 @@ type PropsType = { contentColumnStyle?: CSSProperties; className?: string; children?: JSX.Element | JSX.Element[]; + testClassId?: string; }; const Banner: FC = ({ @@ -27,6 +28,7 @@ const Banner: FC = ({ style, contentColumnStyle, className, + testClassId, }) => { const headerStyle = { height: height ? height : 68, @@ -34,13 +36,15 @@ const Banner: FC = ({ ...style, }; + const testId = testClassId ? `testid:${testClassId}` : '' + return ( - + {content || children || ''} - {closable && } + {closable && } diff --git a/tdrive/frontend/src/app/components/connection-indicator/connection-indicator.tsx b/tdrive/frontend/src/app/components/connection-indicator/connection-indicator.tsx index 7da21911..a22c00c6 100644 --- a/tdrive/frontend/src/app/components/connection-indicator/connection-indicator.tsx +++ b/tdrive/frontend/src/app/components/connection-indicator/connection-indicator.tsx @@ -12,19 +12,19 @@ export default () => { const [{ connected, reconnecting }] = useRecoilState(ConnectedState); return ( -
+
{connected === false && reconnecting !== true && ( -
+
{Languages.t('general.connexion_status.disconnected')}
)} {connected === false && reconnecting === true && ( -
+
{Languages.t('general.connexion_status.connecting')}
)} {connected === true && ( -
+
{Languages.t('general.connexion_status.connected')}
)} diff --git a/tdrive/frontend/src/app/components/file-uploads/pending-file-components/pending-file-row.tsx b/tdrive/frontend/src/app/components/file-uploads/pending-file-components/pending-file-row.tsx index 6c48f4c6..6002c519 100644 --- a/tdrive/frontend/src/app/components/file-uploads/pending-file-components/pending-file-row.tsx +++ b/tdrive/frontend/src/app/components/file-uploads/pending-file-components/pending-file-row.tsx @@ -76,7 +76,7 @@ export default ({ pendingFileState, pendingFile }: PropsType) => { maxWidth: isPendingFileStatusPause(pendingFile.status) ? 130 : 160, verticalAlign: 'middle', }} - className="testid:pending-file-name" + className="testid:file-name" > {capitalize(pendingFile?.originalFile.name)} @@ -100,6 +100,7 @@ export default ({ pendingFileState, pendingFile }: PropsType) => { {pendingFile?.label ? ( { ? Languages.t('general.resume') : Languages.t('general.pause') } + className="pending-file-row-tooltip-file-status" > } diff --git a/tdrive/frontend/src/app/components/object-modal/object-modal.tsx b/tdrive/frontend/src/app/components/object-modal/object-modal.tsx index 697b1e3c..414fcf67 100644 --- a/tdrive/frontend/src/app/components/object-modal/object-modal.tsx +++ b/tdrive/frontend/src/app/components/object-modal/object-modal.tsx @@ -38,7 +38,7 @@ const ObjectModal: FC = (props: PropsType) => { hasSider={false} style={props.style || {}} > -
+
{props.titleCenter && } {props.title && ( @@ -62,7 +62,7 @@ const ObjectModal: FC = (props: PropsType) => { type="times" className={`m-icon-small square-button ${ props.headerStyle?.backgroundColor ? 'red' : '' - }`} + } testid:button-close-modal`} onClick={() => (props?.onClose ? props.onClose() : ModalManager.closeAll())} /> @@ -71,7 +71,7 @@ const ObjectModal: FC = (props: PropsType) => {
{props.children && {props.children}} {props.footer && ( -