From 5cf41fe2c606ce35e8ce1b87b0bf7962e8cccc74 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Tue, 19 Nov 2024 12:04:40 +0100 Subject: [PATCH] refactor: removed unused code --- src/libs/E2E/tests/moneyRequestTest.e2e.ts | 8 -------- tests/e2e/nativeCommands/NativeCommandsAction.ts | 7 +------ tests/e2e/nativeCommands/adbEnter.ts | 9 --------- tests/e2e/nativeCommands/index.ts | 3 --- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 tests/e2e/nativeCommands/adbEnter.ts diff --git a/src/libs/E2E/tests/moneyRequestTest.e2e.ts b/src/libs/E2E/tests/moneyRequestTest.e2e.ts index ca260a2c8ba4..14c438077737 100644 --- a/src/libs/E2E/tests/moneyRequestTest.e2e.ts +++ b/src/libs/E2E/tests/moneyRequestTest.e2e.ts @@ -1,6 +1,5 @@ import Config from 'react-native-config'; import type {NativeConfig} from 'react-native-config'; -import * as E2EGenericPressableWrapper from '@components/Pressable/GenericPressable/index.e2e'; import E2ELogin from '@libs/E2E/actions/e2eLogin'; import waitForAppLoaded from '@libs/E2E/actions/waitForAppLoaded'; import E2EClient from '@libs/E2E/client'; @@ -11,7 +10,6 @@ import Performance from '@libs/Performance'; import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import * as NativeCommands from '../../../../tests/e2e/nativeCommands/NativeCommandsAction'; import {tap, waitFor} from '../interactions'; const test = (config: NativeConfig) => { @@ -72,12 +70,6 @@ const test = (config: NativeConfig) => { Performance.markStart(CONST.TIMING.OPEN_SUBMIT_EXPENSE_CONTACT); tap('next-button'); }, 4000); - /* E2EClient.sendNativeCommand(NativeCommands.makeTypeTextCommand('3')) - .then(() => E2EClient.sendNativeCommand(NativeCommands.makeEnterCommand())) - .then(() => { - const nextButton = E2EGenericPressableWrapper.getPressableProps('next-button'); - nextButton?.onPress?.(); - }); */ } if (entry.name === CONST.TIMING.OPEN_SUBMIT_EXPENSE_CONTACT) { diff --git a/tests/e2e/nativeCommands/NativeCommandsAction.ts b/tests/e2e/nativeCommands/NativeCommandsAction.ts index ad2e00d75b3d..17187ca66f1c 100644 --- a/tests/e2e/nativeCommands/NativeCommandsAction.ts +++ b/tests/e2e/nativeCommands/NativeCommandsAction.ts @@ -4,7 +4,6 @@ const NativeCommandsAction = { scroll: 'scroll', type: 'type', backspace: 'backspace', - enter: 'enter', } as const; const makeTypeTextCommand = (text: string): NativeCommand => ({ @@ -18,8 +17,4 @@ const makeBackspaceCommand = (): NativeCommand => ({ actionName: NativeCommandsAction.backspace, }); -const makeEnterCommand = (): NativeCommand => ({ - actionName: NativeCommandsAction.enter, -}); - -export {NativeCommandsAction, makeTypeTextCommand, makeBackspaceCommand, makeEnterCommand}; +export {NativeCommandsAction, makeTypeTextCommand, makeBackspaceCommand}; diff --git a/tests/e2e/nativeCommands/adbEnter.ts b/tests/e2e/nativeCommands/adbEnter.ts deleted file mode 100644 index ab8b14176ecf..000000000000 --- a/tests/e2e/nativeCommands/adbEnter.ts +++ /dev/null @@ -1,9 +0,0 @@ -import execAsync from '../utils/execAsync'; -import * as Logger from '../utils/logger'; - -const adbBackspace = (): Promise => { - Logger.log(`↳ Pressing enter`); - return execAsync(`adb shell input keyevent KEYCODE_ENTER`).then(() => true); -}; - -export default adbBackspace; diff --git a/tests/e2e/nativeCommands/index.ts b/tests/e2e/nativeCommands/index.ts index a349cd26e0ef..310aa2ab3c22 100644 --- a/tests/e2e/nativeCommands/index.ts +++ b/tests/e2e/nativeCommands/index.ts @@ -1,6 +1,5 @@ import type {NativeCommandPayload} from '@libs/E2E/client'; import adbBackspace from './adbBackspace'; -import adbEnter from './adbEnter'; import adbTypeText from './adbTypeText'; // eslint-disable-next-line rulesdir/prefer-import-module-contents import {NativeCommandsAction} from './NativeCommandsAction'; @@ -13,8 +12,6 @@ const executeFromPayload = (actionName?: string, payload?: NativeCommandPayload) return adbTypeText(payload?.text ?? ''); case NativeCommandsAction.backspace: return adbBackspace(); - case NativeCommandsAction.enter: - return adbEnter(); default: throw new Error(`Unknown action: ${actionName}`); }