diff --git a/src/app/drive/components/EditItemNameDialog/EditItemNameDialog.tsx b/src/app/drive/components/EditItemNameDialog/EditItemNameDialog.tsx index ed56a622a..32942b63e 100644 --- a/src/app/drive/components/EditItemNameDialog/EditItemNameDialog.tsx +++ b/src/app/drive/components/EditItemNameDialog/EditItemNameDialog.tsx @@ -54,7 +54,7 @@ const EditItemNameDialog: FC = ({ item, isOpen, resourc setIsLoading(false); }); } else { - setError(translate('error.folderCannotBeEmpty') as string); + setError(translate('error.folderCannotBeEmpty')); } }; @@ -68,13 +68,17 @@ const EditItemNameDialog: FC = ({ item, isOpen, resourc return ( -
-

{translate('modals.renameItemDialog.title')}

+ +

+ {translate('modals.renameItemDialog.title')} +

{ @@ -87,10 +91,22 @@ const EditItemNameDialog: FC = ({ item, isOpen, resourc />
- -
diff --git a/src/app/shared/components/Button/Button.tsx b/src/app/shared/components/Button/Button.tsx index e66e74cda..ebd351b2c 100644 --- a/src/app/shared/components/Button/Button.tsx +++ b/src/app/shared/components/Button/Button.tsx @@ -13,6 +13,7 @@ export default function Button({ dataTest, autofocus, buttonDataCy, + buttonChildrenDataCy, }: { variant?: 'primary' | 'accent' | 'secondary' | 'tertiary'; type?: 'button' | 'submit'; @@ -25,6 +26,7 @@ export default function Button({ dataTest?: string; autofocus?: boolean; buttonDataCy?: string; + buttonChildrenDataCy?: string; }): JSX.Element { let styles = ''; @@ -59,7 +61,9 @@ export default function Button({ } relative flex shrink-0 select-none flex-row items-center justify-center space-x-2 whitespace-nowrap rounded-lg text-base font-medium outline-none ring-2 ring-primary/0 ring-offset-2 ring-offset-transparent transition-all duration-100 ease-in-out focus-visible:ring-primary/50 ${styles} ${className}`} > {loading && } -
{children}
+
+ {children} +
); } diff --git a/src/app/shared/components/Input/index.tsx b/src/app/shared/components/Input/index.tsx index 9ab8ca6d6..da423f151 100644 --- a/src/app/shared/components/Input/index.tsx +++ b/src/app/shared/components/Input/index.tsx @@ -19,6 +19,8 @@ export default function Input({ dataTest, name, required = false, + labelDataCy, + inputDataCy, }: { className?: string; label?: string; @@ -37,6 +39,8 @@ export default function Input({ dataTest?: string; name?: string; required?: boolean; + labelDataCy?: string; + inputDataCy?: string; }): JSX.Element { const inputRef = useRef(null); @@ -104,6 +108,7 @@ export default function Input({ autoComplete={autoComplete} value={value} data-test={dataTest} + data-cy={inputDataCy} name={name} required={required} /> @@ -167,7 +172,9 @@ export default function Input({
{label ? ( ) : ( diff --git a/src/app/shared/components/List/ListItem.tsx b/src/app/shared/components/List/ListItem.tsx index e73dc7724..7ebd09e56 100644 --- a/src/app/shared/components/List/ListItem.tsx +++ b/src/app/shared/components/List/ListItem.tsx @@ -21,6 +21,7 @@ export type ListItemMenu = Array< interface ItemProps { item: T; + listIndex: number; itemComposition: Array<(props: T) => JSX.Element>; selected: boolean; columnsWidth: Array; @@ -88,6 +89,7 @@ const MenuItemList = ({ export default function ListItem({ item, + listIndex, itemComposition, selected, columnsWidth, @@ -171,6 +173,7 @@ export default function ListItem({ onSelectedChanged(!selected); }} checked={selected} + checkboxDataCy={`driveListItemCheckbox${listIndex}`} />
{disableItemCompositionStyles ? ( @@ -243,6 +246,7 @@ export default function ListItem({ : 'text-gray-60 hover:bg-gray-10 focus-visible:bg-gray-10' }`} onClick={() => onThreeDotsButtonPressed?.(item)} + data-cy={`driveListThreeDotsMenuButton${listIndex}`} > diff --git a/src/app/shared/components/List/index.tsx b/src/app/shared/components/List/index.tsx index 2cf4aebe1..2c2e2e88e 100644 --- a/src/app/shared/components/List/index.tsx +++ b/src/app/shared/components/List/index.tsx @@ -296,10 +296,11 @@ ListProps): JSX.Element { className="h-full" style={{ overflow: 'visible' }} > - {items.map((item) => ( + {items.map((item, index) => ( key={item.id} item={item} + listIndex={index} itemComposition={itemComposition} selected={isItemSelected(item)} onDoubleClick={onDoubleClick && (() => onDoubleClick(item))}