From 2a123cb955055e1105dc0212d159ff3e8842d2f3 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Wed, 26 Jun 2024 21:21:48 +0200 Subject: [PATCH 1/2] Fix missing `TEST_CONST` import in example app --- WebExample/__tests__/input.spec.ts | 2 +- WebExample/__tests__/styles.spec.ts | 2 +- WebExample/__tests__/textManipulation.spec.ts | 2 +- WebExample/__tests__/utils.ts | 2 +- WebExample/playwright.config.ts | 2 +- WebExample/tsconfig.json | 2 +- example/src/App.tsx | 2 +- {WebExample/__tests__ => example/src}/testConstants.ts | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename {WebExample/__tests__ => example/src}/testConstants.ts (100%) diff --git a/WebExample/__tests__/input.spec.ts b/WebExample/__tests__/input.spec.ts index 7854dcb4..f3accc26 100644 --- a/WebExample/__tests__/input.spec.ts +++ b/WebExample/__tests__/input.spec.ts @@ -1,5 +1,5 @@ import {test, expect} from '@playwright/test'; -import * as TEST_CONST from './testConstants'; +import * as TEST_CONST from '../../example/src/testConstants'; import {checkCursorPosition, setupInput} from './utils'; test.beforeEach(async ({page}) => { diff --git a/WebExample/__tests__/styles.spec.ts b/WebExample/__tests__/styles.spec.ts index 2fc87dc5..665957f1 100644 --- a/WebExample/__tests__/styles.spec.ts +++ b/WebExample/__tests__/styles.spec.ts @@ -1,6 +1,6 @@ import {test, expect} from '@playwright/test'; import type {Page} from '@playwright/test'; -import * as TEST_CONST from './testConstants'; +import * as TEST_CONST from '../../example/src/testConstants'; import {setupInput, getElementStyle} from './utils'; const testMarkdownContentStyle = async ({testContent, style, page}: {testContent: string; style: string; page: Page}) => { diff --git a/WebExample/__tests__/textManipulation.spec.ts b/WebExample/__tests__/textManipulation.spec.ts index d117da39..5c83e3b4 100644 --- a/WebExample/__tests__/textManipulation.spec.ts +++ b/WebExample/__tests__/textManipulation.spec.ts @@ -1,6 +1,6 @@ import {test, expect} from '@playwright/test'; import type {Locator, Page} from '@playwright/test'; -import * as TEST_CONST from './testConstants'; +import * as TEST_CONST from '../../example/src/testConstants'; import {checkCursorPosition, setupInput, getElementStyle, pressCmd} from './utils'; const pasteContent = async ({text, page, inputLocator}: {text: string; page: Page; inputLocator: Locator}) => { diff --git a/WebExample/__tests__/utils.ts b/WebExample/__tests__/utils.ts index f50e6684..8b588348 100644 --- a/WebExample/__tests__/utils.ts +++ b/WebExample/__tests__/utils.ts @@ -1,5 +1,5 @@ import type {Locator, Page} from '@playwright/test'; -import * as TEST_CONST from './testConstants'; +import * as TEST_CONST from '../../example/src/testConstants'; const setupInput = async (page: Page, action?: 'clear' | 'reset') => { const inputLocator = await page.locator(`div#${TEST_CONST.INPUT_ID}`); diff --git a/WebExample/playwright.config.ts b/WebExample/playwright.config.ts index 0cf53a25..b8905830 100644 --- a/WebExample/playwright.config.ts +++ b/WebExample/playwright.config.ts @@ -1,5 +1,5 @@ import {defineConfig, devices} from '@playwright/test'; -import * as TEST_CONST from './__tests__/testConstants'; +import * as TEST_CONST from '../example/src/testConstants'; export default defineConfig({ testDir: './__tests__', diff --git a/WebExample/tsconfig.json b/WebExample/tsconfig.json index 5ede5186..713db2f5 100644 --- a/WebExample/tsconfig.json +++ b/WebExample/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "strict": true }, - "include": ["App.tsx", "**/*.ts", "__tests__/testConstants.ts"], + "include": ["App.tsx", "**/*.ts"], "exclude": ["node_modules"] } diff --git a/example/src/App.tsx b/example/src/App.tsx index 71648f56..aae9b063 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -4,7 +4,7 @@ import {Button, Platform, StyleSheet, Text, View} from 'react-native'; import {MarkdownTextInput} from '@expensify/react-native-live-markdown'; import type {TextInput} from 'react-native'; -import * as TEST_CONST from '../../WebExample/__tests__/testConstants'; +import * as TEST_CONST from './testConstants'; function isWeb() { return Platform.OS === 'web'; diff --git a/WebExample/__tests__/testConstants.ts b/example/src/testConstants.ts similarity index 100% rename from WebExample/__tests__/testConstants.ts rename to example/src/testConstants.ts From 72b55f23e2167cd43c39839c64f5ba0d6a135f7a Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Thu, 27 Jun 2024 09:51:26 +0200 Subject: [PATCH 2/2] Update tsconfig.json --- example/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/tsconfig.json b/example/tsconfig.json index 77ef13fc..0e875a5a 100644 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "strict": true }, - "include": ["src/App.tsx", "./index.ts"], + "include": ["src/App.tsx", "src/testConstants.ts", "./index.ts"], "exclude": ["node_modules"] }