From 9a694071ce757d0f8a269b52b4fcfd2c31e4d102 Mon Sep 17 00:00:00 2001 From: mmarkusik Date: Tue, 26 Jan 2021 11:21:54 +0100 Subject: [PATCH] Saleor 2078/create cypress test ids (#958) * Add first id * Add more ids * Add more test ids * Fix typing * Remove unnecessary import * Update snapshots --- .../components/ChannelForm/ChannelForm.tsx | 12 ++++++++++++ src/channels/components/ChannelForm/types.ts | 5 +++++ src/components/AppHeader/AppHeader.tsx | 6 +++++- src/components/AppLayout/AppChannelSelect.tsx | 1 + .../ChannelsAvailability/ChannelsAvailability.tsx | 6 +++++- .../ChannelsAvailabilityContent.tsx | 5 ++++- .../SingleAutocompleteSelectField.tsx | 4 ++++ .../SingleSelectField/SingleSelectField.tsx | 5 ++++- .../OrderDraftDetails/OrderDraftDetails.tsx | 7 ++++++- .../components/OrderListPage/OrderListPage.tsx | 7 ++++++- src/storybook/__snapshots__/Stories.test.ts.snap | 15 +++++++++++++++ 11 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 src/channels/components/ChannelForm/types.ts diff --git a/src/channels/components/ChannelForm/ChannelForm.tsx b/src/channels/components/ChannelForm/ChannelForm.tsx index 07fca80a3..2d362acaa 100644 --- a/src/channels/components/ChannelForm/ChannelForm.tsx +++ b/src/channels/components/ChannelForm/ChannelForm.tsx @@ -20,6 +20,7 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { useStyles } from "../styles"; +import { ExtendedFormHelperTextProps } from "./types"; export interface FormData { name: string; @@ -80,6 +81,11 @@ export const ChannelForm: React.FC = ({ helperText={getChannelsErrorMessage(formErrors?.slug, intl)} disabled={disabled} fullWidth + FormHelperTextProps={ + { + "data-testid": "slug-text-input-helper-text" + } as ExtendedFormHelperTextProps + } label={intl.formatMessage({ defaultMessage: "Slug", description: "channel slug" @@ -124,8 +130,14 @@ export const ChannelForm: React.FC = ({ {!!currencyCodes ? ( = props => { {anchor => anchor ? ( -
+
{children ? ( {children} diff --git a/src/components/AppLayout/AppChannelSelect.tsx b/src/components/AppLayout/AppChannelSelect.tsx index c9385288a..944443585 100644 --- a/src/components/AppLayout/AppChannelSelect.tsx +++ b/src/components/AppLayout/AppChannelSelect.tsx @@ -38,6 +38,7 @@ const AppChannelSelect: React.FC = ({ return (
= props = userPermissions={user?.userPermissions || []} requiredPermissions={[PermissionEnum.MANAGE_CHANNELS]} > -