Skip to content

Commit

Permalink
Merge pull request Expensify#27978 from Expensify/Rory-DynamicTestIDs
Browse files Browse the repository at this point in the history
[No QA] Use displayName for testID
  • Loading branch information
AndrewGable authored Sep 22, 2023
2 parents 0e9a1c1 + f940339 commit 1f628bd
Show file tree
Hide file tree
Showing 103 changed files with 106 additions and 106 deletions.
2 changes: 1 addition & 1 deletion src/components/AvatarCropModal/AvatarCropModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function AvatarCropModal(props) {
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID="AvatarCropModal"
testID={AvatarCropModal.displayName}
>
{props.isSmallScreenWidth && <HeaderGap />}
<HeaderWithBackButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/CountryPicker/CountrySelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function CountrySelectorModal({currentCountry, isVisible, onClose, onCountrySele
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID="CountrySelectorModal"
testID={CountrySelectorModal.displayName}
>
<HeaderWithBackButton
title={translate('common.country')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/DistanceRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken,
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableKeyboardAvoidingView={false}
testID="DistanceRequest"
testID={DistanceRequest.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
<FullPageNotFoundView shouldShow={!IOUUtils.isValidMoneyRequestType(iouType)}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderPageLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function HeaderPageLayout({backgroundColor, children, footer, headerContainerSty
shouldEnablePickerAvoiding={false}
includeSafeAreaPaddingBottom={false}
offlineIndicatorStyle={[appBGColor]}
testID="HeaderPageLayout"
testID={HeaderPageLayout.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function YearPickerModal(props) {
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID="YearPickerModal"
testID={YearPickerModal.displayName}
>
<HeaderWithBackButton
title={translate('yearPickerPage.year')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReimbursementAccountLoadingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function ReimbursementAccountLoadingIndicator(props) {
<ScreenWrapper
shouldShowOfflineIndicator={false}
style={[StyleSheet.absoluteFillObject, styles.reimbursementAccountFullScreenLoading]}
testID="ReimbursementAccountLoadingIndicator"
testID={ReimbursementAccountLoadingIndicator.displayName}
>
<HeaderWithBackButton
title={translate('reimbursementAccountLoadingAnimation.oneMoment')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatePicker/StateSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function StateSelectorModal({currentState, isVisible, onClose, onStateSelected,
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID="StateSelectorModal"
testID={StateSelectorModal.displayName}
>
<HeaderWithBackButton
title={label || translate('common.state')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AddPersonalBankAccountPage extends React.Component {
includeSafeAreaPaddingBottom={shouldShowSuccess}
shouldEnablePickerAvoiding={false}
shouldShowOfflineIndicator={false}
testID="AddPersonalBankAccountPage"
testID={AddPersonalBankAccountPage.displayName}
>
<HeaderWithBackButton
title={this.props.translate('bankAccount.addBankAccount')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function DetailsPage(props) {
const isCurrentUser = _.keys(props.loginList).includes(details.login);

return (
<ScreenWrapper testID="DetailsPage">
<ScreenWrapper testID={DetailsPage.displayName}>
<FullPageNotFoundView shouldShow={_.isEmpty(login)}>
<HeaderWithBackButton title={props.translate('common.details')} />
<View
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function EditRequestAmountPage({defaultAmount, defaultCurrency, onSubmit, report
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID="EditRequestAmountPage"
testID={EditRequestAmountPage.displayName}
>
<HeaderWithBackButton title={translate('iou.amount')} />
<MoneyRequestAmountForm
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestCategoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function EditRequestCategoryPage({defaultCategory, policyID, onSubmit}) {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID="EditRequestCategoryPage"
testID={EditRequestCategoryPage.displayName}
>
<HeaderWithBackButton
title={translate('common.category')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestCreatedPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function EditRequestCreatedPage({defaultCreated, onSubmit}) {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID="EditRequestCreatedPage"
testID={EditRequestCreatedPage.displayName}
>
<HeaderWithBackButton title={translate('common.date')} />
<Form
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) {
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
onEntryTransitionEnd={() => descriptionInputRef.current && descriptionInputRef.current.focus()}
testID="EditRequestDescriptionPage"
testID={EditRequestDescriptionPage.displayName}
>
<HeaderWithBackButton title={translate('common.description')} />
<Form
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestMerchantPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function EditRequestMerchantPage({defaultMerchant, onSubmit}) {
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
onEntryTransitionEnd={() => merchantInputRef.current && merchantInputRef.current.focus()}
testID="EditRequestMerchantPage"
testID={EditRequestMerchantPage.displayName}
>
<HeaderWithBackButton title={translate('common.merchant')} />
<Form
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestReceiptPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function EditRequestReceiptPage({route, transactionID}) {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID="EditRequestReceiptPage"
testID={EditRequestReceiptPage.displayName}
>
<HeaderWithBackButton
title={translate('common.receipt')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EnablePayments/AdditionalDetailsStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function AdditionalDetailsStep({walletAdditionalDetails, translate, currentUserP
<ScreenWrapper
style={[styles.flex1]}
keyboardAvoidingViewBehavior="height"
testID="AdditionalDetailsStep"
testID={AdditionalDetailsStep.displayName}
>
<HeaderWithBackButton
title={translate('additionalDetailsStep.headerTitle')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EnablePayments/EnablePaymentsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class EnablePaymentsPage extends React.Component {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="EnablePaymentsPage"
testID={EnablePaymentsPage.displayName}
>
{() => {
if (this.props.userWallet.errorCode === CONST.WALLET.ERROR.KYC) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ErrorPage/NotFoundPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoun
// eslint-disable-next-line rulesdir/no-negated-variables
function NotFoundPage() {
return (
<ScreenWrapper testID="NotFoundPage">
<ScreenWrapper testID={NotFoundPage.displayName}>
<FullPageNotFoundView shouldShow />
</ScreenWrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FlagCommentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function FlagCommentPage(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="FlagCommentPage"
testID={FlagCommentPage.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
<FullPageNotFoundView shouldShow={!ReportUtils.shouldShowFlagComment(getActionToFlag(), props.report)}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/GetAssistancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function GetAssistancePage(props) {
}

return (
<ScreenWrapper testID="GetAssistancePage">
<ScreenWrapper testID={GetAssistancePage.displayName}>
<HeaderWithBackButton
title={props.translate('getAssistancePage.title')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function NewChatPage({betas, isGroupChat, personalDetails, reports, translate})
includeSafeAreaPaddingBottom={false}
includePaddingTop={false}
shouldEnableMaxHeight
testID="NewChatPage"
testID={NewChatPage.displayName}
>
{({safeAreaPaddingBottomStyle, insets}) => (
<KeyboardAvoidingView
Expand Down
2 changes: 1 addition & 1 deletion src/pages/NewChatSelectorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function NewChatSelectorPage(props) {
shouldEnableKeyboardAvoidingView={false}
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID="NewChatSelectorPage"
testID={NewChatSelectorPage.displayName}
>
<HeaderWithBackButton
title={props.translate('sidebarScreen.fabNewChat')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
onEntryTransitionEnd={() => focusAndUpdateMultilineInputRange(privateNotesInput.current)}
testID="PrivateNotesEditPage"
testID={PrivateNotesEditPage.displayName}
>
<FullPageNotFoundView
shouldShow={_.isEmpty(report) || _.isEmpty(report.privateNotes) || !_.has(report, ['privateNotes', route.params.accountID, 'note']) || !isCurrentUserNote}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivateNotes/PrivateNotesListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function PrivateNotesListPage({report, personalDetailsList, network, session}) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="PrivateNotesListPage"
testID={PrivateNotesListPage.displayName}
>
<FullPageNotFoundView shouldShow={_.isEmpty(report.reportID) || (!report.isLoadingPrivateNotes && network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {})))}>
<HeaderWithBackButton
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivateNotes/PrivateNotesViewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function PrivateNotesViewPage({route, personalDetailsList, session, report}) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="PrivateNotesViewPage"
testID={PrivateNotesViewPage.displayName}
>
<FullPageNotFoundView
shouldShow={_.isEmpty(report) || _.isEmpty(report.privateNotes) || !_.has(report, ['privateNotes', route.params.accountID, 'note'])}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function ProfilePage(props) {
}, [accountID, hasMinimumDetails]);

return (
<ScreenWrapper testID="ProfilePage">
<ScreenWrapper testID={ProfilePage.displayName}>
<HeaderWithBackButton
title={props.translate('common.profile')}
onBackButtonPress={() => Navigation.goBack(navigateBackTo)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/ACHContractStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function ACHContractStep(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="ACHContractStep"
testID={ACHContractStep.displayName}
>
<HeaderWithBackButton
title={props.translate('beneficialOwnersStep.additionalInformation')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/BankAccountManualStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function BankAccountManualStep(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="BankAccountManualStep"
testID={BankAccountManualStep.displayName}
>
<HeaderWithBackButton
title={translate('workspace.common.connectBankAccount')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/BankAccountPlaidStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function BankAccountPlaidStep(props) {
includeSafeAreaPaddingBottom={false}
shouldEnablePickerAvoiding={false}
shouldShowOfflineIndicator={false}
testID="BankAccountPlaidStep"
testID={BankAccountPlaidStep.displayName}
>
<HeaderWithBackButton
title={translate('workspace.common.connectBankAccount')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/BankAccountStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function BankAccountStep(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="BankAccountStep"
testID={BankAccountStep.displayName}
>
<View style={[styles.flex1, styles.justifyContentBetween]}>
<HeaderWithBackButton
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function CompanyStep({reimbursementAccount, reimbursementAccountDraft, getDefaul
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="CompanyStep"
testID={CompanyStep.displayName}
>
<HeaderWithBackButton
title={translate('companyStep.headerTitle')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/ContinueBankAccountSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function ContinueBankAccountSetup(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="ContinueBankAccountSetup"
testID={ContinueBankAccountSetup.displayName}
>
<HeaderWithBackButton
title={props.translate('workspace.common.connectBankAccount')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/EnableStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function EnableStep(props) {
<ScreenWrapper
style={[styles.flex1, styles.justifyContentBetween]}
includeSafeAreaPaddingBottom={false}
testID="EnableStep"
testID={EnableStep.displayName}
>
<HeaderWithBackButton
title={props.translate('workspace.common.connectBankAccount')}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class ReimbursementAccountPage extends React.Component {

if (_.isEmpty(this.props.policy) || !PolicyUtils.isPolicyAdmin(this.props.policy)) {
return (
<ScreenWrapper testID="ReimbursementAccountPage">
<ScreenWrapper testID={ReimbursementAccountPage.displayName}>
<FullPageNotFoundView
shouldShow
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
Expand Down Expand Up @@ -385,7 +385,7 @@ class ReimbursementAccountPage extends React.Component {

if (errorText) {
return (
<ScreenWrapper testID="ReimbursementAccountPage">
<ScreenWrapper testID={ReimbursementAccountPage.displayName}>
<HeaderWithBackButton
title={this.props.translate('workspace.common.connectBankAccount')}
subtitle={policyName}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/RequestorOnfidoStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RequestorOnfidoStep extends React.Component {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldShowOfflineIndicator={false}
testID="RequestorOnfidoStep"
testID={RequestorOnfidoStep.displayName}
>
<HeaderWithBackButton
title={this.props.translate('requestorStep.headerTitle')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/RequestorStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class RequestorStep extends React.Component {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="RequestorStep"
testID={RequestorStep.displayName}
>
<HeaderWithBackButton
title={this.props.translate('requestorStep.headerTitle')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/ValidationStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ValidationStep extends React.Component {
<ScreenWrapper
style={[styles.flex1, styles.justifyContentBetween]}
includeSafeAreaPaddingBottom={false}
testID="ValidationStep"
testID={ValidationStep.displayName}
>
<HeaderWithBackButton
title={isVerifying ? this.props.translate('validationStep.headerTitle') : this.props.translate('workspace.common.testTransactions')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function ReportDetailsPage(props) {
) : null;

return (
<ScreenWrapper testID="ReportDetailsPage">
<ScreenWrapper testID={ReportDetailsPage.displayName}>
<FullPageNotFoundView shouldShow={_.isEmpty(props.report)}>
<HeaderWithBackButton title={props.translate('common.details')} />
<ScrollView style={[styles.flex1]}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function ReportParticipantsPage(props) {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="ReportParticipantsPage"
testID={ReportParticipantsPage.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
<FullPageNotFoundView shouldShow={_.isEmpty(props.report) || ReportUtils.isArchivedRoom(props.report)}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportWelcomeMessagePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ReportWelcomeMessagePage(props) {
}
focusAndUpdateMultilineInputRange(welcomeMessageInputRef.current);
}}
testID="ReportWelcomeMessagePage"
testID={ReportWelcomeMessagePage.displayName}
>
{({didScreenTransitionEnd}) => (
<FullPageNotFoundView shouldShow={!PolicyUtils.isPolicyAdmin(props.policy)}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class SearchPage extends Component {
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID="SearchPage"
testID={SearchPage.displayName}
>
{({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ShareCodePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ShareCodePage extends React.Component {
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;

return (
<ScreenWrapper testID="ShareCodePage">
<ScreenWrapper testID={ShareCodePage.displayName}>
<HeaderWithBackButton
title={this.props.translate('common.shareCode')}
onBackButtonPress={() => Navigation.goBack(isReport ? ROUTES.getReportDetailsRoute(this.props.report.reportID) : ROUTES.SETTINGS)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TeachersUnite/ImTeacherUpdateEmailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function ImTeacherUpdateEmailPage() {
const {translate} = useLocalize();

return (
<ScreenWrapper testID="ImTeacherPage">
<ScreenWrapper testID={ImTeacherUpdateEmailPage.displayName}>
<HeaderWithBackButton
title={translate('teachersUnitePage.iAmATeacher')}
onBackButtonPress={() => Navigation.goBack(ROUTES.TEACHERS_UNITE)}
Expand Down
Loading

0 comments on commit 1f628bd

Please sign in to comment.