-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into @maksg/performance-fixes-ios
- Loading branch information
Showing
84 changed files
with
5,357 additions
and
2,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Test web E2E | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/web-e2e-test.yml | ||
- src/** | ||
- WebExample/** | ||
merge_group: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/web-e2e-test.yml | ||
- src/** | ||
- WebExample/** | ||
|
||
jobs: | ||
test: | ||
if: github.repository == 'Expensify/react-native-live-markdown' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./WebExample | ||
|
||
concurrency: | ||
group: web-e2e-test-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install node_modules | ||
run: yarn install --immutable | ||
|
||
- name: Install browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Install dependencies for browsers | ||
run: npx playwright install-deps | ||
|
||
- name: Run Playwright tests | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,3 +79,4 @@ lib/ | |
|
||
# react-native-live-markdown | ||
android/src/main/assets/react-native-live-markdown-parser.js | ||
.build_complete |
426 changes: 213 additions & 213 deletions
426
.yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,7 @@ yarn-error.* | |
|
||
# typescript | ||
*.tsbuildinfo | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
'@lwc/lwc/no-async-await': 'off', | ||
'rulesdir/prefer-import-module-contents': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import * as TEST_CONST from '../../example/src/testConstants'; | ||
import {getCursorPosition, getElementValue, setupInput} from './utils'; | ||
|
||
test.beforeEach(async ({page}) => { | ||
await page.goto(TEST_CONST.LOCAL_URL, {waitUntil: 'load'}); | ||
}); | ||
|
||
test.describe('typing', () => { | ||
test('short text', async ({page}) => { | ||
const inputLocator = await setupInput(page, 'clear'); | ||
|
||
await inputLocator.focus(); | ||
await inputLocator.pressSequentially(TEST_CONST.EXAMPLE_CONTENT); | ||
|
||
expect(await getElementValue(inputLocator)).toEqual(TEST_CONST.EXAMPLE_CONTENT); | ||
}); | ||
|
||
test('fast type cursor position', async ({page}) => { | ||
const EXAMPLE_LONG_CONTENT = TEST_CONST.EXAMPLE_CONTENT.repeat(3); | ||
|
||
const inputLocator = await setupInput(page, 'clear'); | ||
|
||
await inputLocator.pressSequentially(EXAMPLE_LONG_CONTENT); | ||
|
||
expect(await getElementValue(inputLocator)).toBe(EXAMPLE_LONG_CONTENT); | ||
|
||
const cursorPosition = await getCursorPosition(inputLocator); | ||
|
||
expect(cursorPosition.end).toBe(EXAMPLE_LONG_CONTENT.length); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import type {Page} from '@playwright/test'; | ||
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}) => { | ||
const inputLocator = await setupInput(page); | ||
|
||
const elementHandle = inputLocator.locator('span', {hasText: testContent}).last(); | ||
const elementStyle = await getElementStyle(elementHandle); | ||
|
||
expect(elementStyle).toEqual(style); | ||
}; | ||
|
||
test.beforeEach(async ({page}) => { | ||
await page.goto(TEST_CONST.LOCAL_URL, {waitUntil: 'load'}); | ||
await page.click('[data-testid="reset"]'); | ||
}); | ||
|
||
test.describe('markdown content styling', () => { | ||
test('bold', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'world', style: 'font-weight: bold;', page}); | ||
}); | ||
|
||
test('link', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'https://expensify.com', style: 'color: blue; text-decoration: underline;', page}); | ||
}); | ||
|
||
test('h1', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'header1', style: 'font-size: 25px; font-weight: bold;', page}); | ||
}); | ||
|
||
test('inline code', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'inline code', style: 'font-family: monospace; font-size: 20px; color: black; background-color: lightgray;', page}); | ||
}); | ||
|
||
test('codeblock', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'codeblock', style: 'font-family: monospace; font-size: 20px; color: black; background-color: lightgray;', page}); | ||
}); | ||
|
||
test('mention-here', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'here', style: 'color: green; background-color: lime;', page}); | ||
}); | ||
|
||
test('mention-user', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'someone@swmansion.com', style: 'color: blue; background-color: cyan;', page}); | ||
}); | ||
|
||
test('mention-report', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'mention-report', style: 'color: red; background-color: pink;', page}); | ||
}); | ||
|
||
test('blockquote', async ({page, browserName}) => { | ||
const blockquoteStyle = | ||
'border-color: gray; border-width: 6px; margin-left: 6px; padding-left: 6px; border-left-style: solid; display: inline-block; max-width: 100%; box-sizing: border-box;'; | ||
|
||
// Firefox border properties are serialized slightly differently | ||
const browserStyle = browserName === 'firefox' ? blockquoteStyle.replace('border-left-style: solid', 'border-left: 6px solid gray') : blockquoteStyle; | ||
|
||
await testMarkdownContentStyle({testContent: 'blockquote', style: browserStyle, page}); | ||
}); | ||
}); |
Oops, something went wrong.