diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index b13d25090..644f59fa2 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -154,6 +154,9 @@ const LoginCard = withStyles(styles, { name: "LoginCard" })( name="email" onChange={handleChange} value={data.email} + inputProps={{ + "data-tc": "email" + }} />
@@ -181,6 +185,7 @@ const LoginCard = withStyles(styles, { name: "LoginCard" })( variant="contained" onClick={handleSubmit} type="submit" + data-tc="submit" > {i18n.t("Login")} diff --git a/src/components/AppLayout/MenuList.tsx b/src/components/AppLayout/MenuList.tsx index 82fbce2e4..b22603f3e 100644 --- a/src/components/AppLayout/MenuList.tsx +++ b/src/components/AppLayout/MenuList.tsx @@ -233,6 +233,7 @@ const MenuList = withStyles(styles, { name: "MenuList" })( menuItem.ariaLabel === activeSubMenu.label && activeSubMenu.isActive })} + data-tc={menuItem.label} onClick={() => handleSubMenu(menuItem.ariaLabel)} > closeSubMenu({ isActive: false, @@ -178,6 +179,7 @@ const MenuNested = withStyles(styles, { name: "MenuNested" })( closeMenu(item.url, event)} key={item.label} > diff --git a/src/components/ImageTile/ImageTile.tsx b/src/components/ImageTile/ImageTile.tsx index e1f320b4e..8becd3fa2 100644 --- a/src/components/ImageTile/ImageTile.tsx +++ b/src/components/ImageTile/ImageTile.tsx @@ -60,7 +60,7 @@ interface ImageTileProps extends WithStyles { const ImageTile = withStyles(styles, { name: "ImageTile" })( ({ classes, onImageDelete, onImageEdit, image }: ImageTileProps) => ( -
+
{onImageEdit && ( diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx index 7c6ac5d97..66a46f145 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx @@ -123,7 +123,8 @@ export const MultiAutocompleteSelectFieldComponent = withStyles(styles, { placeholder, value, fetchChoices, - onChange + onChange, + ...props }: MultiAutocompleteSelectFieldProps & WithStyles) => { const handleSelect = ( item: string, @@ -153,7 +154,7 @@ export const MultiAutocompleteSelectFieldComponent = withStyles(styles, { highlightedIndex, inputValue }) => ( -
+
{i18n.t("Add new value: {{ value }}", { @@ -250,7 +254,11 @@ export const MultiAutocompleteSelectFieldComponent = withStyles(styles, { ) : ( !loading && ( - + {i18n.t("No results found")} ) diff --git a/src/components/ProductList/ProductList.tsx b/src/components/ProductList/ProductList.tsx index 4aa0b39da..949cad712 100644 --- a/src/components/ProductList/ProductList.tsx +++ b/src/components/ProductList/ProductList.tsx @@ -173,6 +173,7 @@ export const ProductList = withStyles(styles, { name: "ProductList" })( key={product ? product.id : "skeleton"} onClick={product && onRowClick(product.id)} className={classes.link} + data-tc={product ? `product-${product.id}` : undefined} > {labels && labels.delete ? labels.delete @@ -114,6 +115,7 @@ export const SaveButtonBar = withStyles(styles, { name: "SaveButtonBar" })( className={classes.cancelButton} variant="text" onClick={onCancel} + data-tc="button-bar-cancel" > {maybe( () => labels.cancel, @@ -126,6 +128,7 @@ export const SaveButtonBar = withStyles(styles, { name: "SaveButtonBar" })( disabled={disabled} onClick={onSave} transitionState={state} + data-tc="button-bar-confirm" > {maybe( () => labels.save, diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx index 35bab83f6..66105963c 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx @@ -93,7 +93,8 @@ const SingleAutocompleteSelectFieldComponent = withStyles(styles, { value, InputProps, fetchChoices, - onChange + onChange, + ...props }: SingleAutocompleteSelectFieldProps & WithStyles) => { const [prevDisplayValue] = useStateFromProps(displayValue); const handleChange = item => @@ -136,7 +137,7 @@ const SingleAutocompleteSelectFieldComponent = withStyles(styles, { } return ( -
+
{i18n.t("None")} @@ -195,6 +197,7 @@ const SingleAutocompleteSelectFieldComponent = withStyles(styles, { index: choiceIndex, item: suggestion.value })} + data-tc="singleautocomplete-select-option" > {suggestion.label} @@ -215,6 +218,7 @@ const SingleAutocompleteSelectFieldComponent = withStyles(styles, { {...getItemProps({ item: inputValue })} + data-tc="singleautocomplete-select-option" > {i18n.t("Add new value: {{ value }}", { context: "add custom option", @@ -224,7 +228,11 @@ const SingleAutocompleteSelectFieldComponent = withStyles(styles, { )} ) : ( - + {i18n.t("No results found")} )} diff --git a/src/components/TablePagination/TablePaginationActions.tsx b/src/components/TablePagination/TablePaginationActions.tsx index d60a97174..e01826fcf 100644 --- a/src/components/TablePagination/TablePaginationActions.tsx +++ b/src/components/TablePagination/TablePaginationActions.tsx @@ -88,6 +88,7 @@ export const TablePaginationActions = withStyles(styles, { })} onClick={onPreviousPage} disabled={!hasPreviousPage} + data-tc="button-pagination-back" {...backIconButtonProps} > {theme.direction === "rtl" ? : } @@ -99,6 +100,7 @@ export const TablePaginationActions = withStyles(styles, { })} onClick={onNextPage} disabled={!hasNextPage} + data-tc="button-pagination-next" {...nextIconButtonProps} > {theme.direction === "rtl" ? : } diff --git a/src/components/messages/MessageManager.tsx b/src/components/messages/MessageManager.tsx index 12bce2e46..11f4f659f 100644 --- a/src/components/messages/MessageManager.tsx +++ b/src/components/messages/MessageManager.tsx @@ -71,7 +71,11 @@ export class MessageManager extends React.Component<{}, MessageManagerState> { ContentProps={{ "aria-describedby": "message-id" }} - message={{text}} + message={ + + {text} + + } action={[ !!onUndo ? ( diff --git a/src/products/components/ProductAttributes/ProductAttributes.tsx b/src/products/components/ProductAttributes/ProductAttributes.tsx index e7c085491..b6e96efc6 100644 --- a/src/products/components/ProductAttributes/ProductAttributes.tsx +++ b/src/products/components/ProductAttributes/ProductAttributes.tsx @@ -147,6 +147,7 @@ const ProductAttributes: React.FC = ({ = ({ {attributeIndex > 0 &&
} -
+
{attribute.label}
-
+
{attribute.data.inputType === AttributeInputTypeEnum.DROPDOWN ? ( {i18n.t("Upload image")} diff --git a/src/products/components/ProductListPage/ProductListPage.tsx b/src/products/components/ProductListPage/ProductListPage.tsx index 0b075177b..f94cf5ef0 100644 --- a/src/products/components/ProductListPage/ProductListPage.tsx +++ b/src/products/components/ProductListPage/ProductListPage.tsx @@ -99,7 +99,12 @@ export const ProductListPage: React.FC = props => { onReset={handleReset} onSave={handleSave} /> - diff --git a/src/products/components/ProductOrganization/ProductOrganization.tsx b/src/products/components/ProductOrganization/ProductOrganization.tsx index 31e010bba..69832c012 100644 --- a/src/products/components/ProductOrganization/ProductOrganization.tsx +++ b/src/products/components/ProductOrganization/ProductOrganization.tsx @@ -101,6 +101,7 @@ const ProductOrganization = withStyles(styles, { name: "ProductOrganization" })( choices={productTypes} value={data.productType} onChange={onProductTypeChange} + data-tc="product-type" /> ) : ( <> @@ -137,6 +138,7 @@ const ProductOrganization = withStyles(styles, { name: "ProductOrganization" })( value={data.category} onChange={onCategoryChange} fetchChoices={fetchCategories} + data-tc="category" />
@@ -152,6 +154,7 @@ const ProductOrganization = withStyles(styles, { name: "ProductOrganization" })( )} onChange={onCollectionChange} fetchChoices={fetchCollections} + data-tc="collections" /> diff --git a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx index 3693e0224..a8da22fe2 100644 --- a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx +++ b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx @@ -93,6 +93,7 @@ const ProductVariantAttributes: React.FC = ({ value={getAttributeValue(attribute.id, attributes)} choices={getAttributeValueChoices(attribute.id, attributes)} allowCustomValues + data-tc="variant-attribute-input" /> ); }) diff --git a/src/products/components/ProductVariants/ProductVariants.tsx b/src/products/components/ProductVariants/ProductVariants.tsx index 6784d352d..9b88a7e3f 100644 --- a/src/products/components/ProductVariants/ProductVariants.tsx +++ b/src/products/components/ProductVariants/ProductVariants.tsx @@ -94,10 +94,20 @@ export const ProductVariants = withStyles(styles, { name: "ProductVariants" })( title={i18n.t("Variants")} toolbar={ <> - -