Repository navigation
Conversation
…remove redundant unit coverage
## Description
Remove twelve repeated checks: duplicate block-conversion and extension-type assertions, editor-state parsing cases that serialize the same document, and eight jsdom mutation cases already exercised by the browser suite with the same fixtures.
Correct three copied cases to exercise their advertised inputs: peer-first extension ordering, insertion after the middle list item, and segmented text insertion. Keep cases whose identical bodies run against different highlighters, editor modes, or fixtures.
## Test plan
### Before
The baseline unit run passed; these redundant checks do not cause a correctness failure. The source audit compared parsed test bodies and their surrounding fixtures.
### After
`pnpm exec vitest run --project unit LexicalBuilder.test.ts LexicalListItemNode.test.ts LexicalSelection.test.tsx LexicalEditor.test.tsx LexicalExtensionCore.test.ts LexicalNode.test.ts ManagedLineBreakObservedRemoval.test.ts --maxWorkers=4`
```text
Test Files 7 passed (7)
Tests 577 passed (577)
```
The retained managed-line-break browser coverage passes in Chromium and WebKit. Firefox could not start a content process in the local sandbox. Browser validation used available Chromium 141 and WebKit 26 builds; the repository's Playwright dependency is unchanged.
…r tests ## Description Move 22 rich-text E2E cases (and their plain-text variants) into Vitest browser mode: character-limit overflow, max-length boundaries and paste, select-all deletion, synthetic clipboard plus execCommand, and text mutation observers. Keep native keyboard input, DOM and editor-state checks, caret assertions, Unicode cases, and both editor modes. Wait for the editor state when observing external text mutations. Keep three playground integration cases for the character-limit/autolink combination and the max-length setting. The Chromium E2E inventory falls from 687 to 665 cases. The browser migration group now runs 52 checks, including the existing character-limit cases and the new plain-text coverage. ## Test plan ### Before Run the five original E2E files, copied from the base commit, against a development build with the default action delay: ```text 25 passed (16.9s) ``` The JSON report records 58.24 seconds summed across test attempts. ### After `pnpm run test-browser --maxWorkers=4 --reporter=json` The full Chromium JSON report records 1,098 passing checks and no failures. The five migration suites run 52 passing checks in 5.88 seconds elapsed (7.05 seconds summed across suites). The retained E2E checks pass in both modes: ```text 3 passed (3.8s) 3 passed (3.1s) ``` The migrated cases also pass in WebKit, including the final mutation-state polling change (4 checks across Chromium and WebKit). Local engines were Chromium 141 and WebKit 26; their matching Playwright driver was used for WebKit validation without changing repository dependencies. Firefox cannot create its content process in this sandbox, and validation against the repository's exact browser revisions remains for CI. TypeScript test checking, ESLint, formatting, package builds, and the playground development build pass.
…ization
## Description
Check newline-splitting batches against an explicit argument limit with 8,193 line feeds instead of constructing 600,000 nodes to reach a machine-dependent native limit. Preserve author, peer and fresh-reader content checks and the original stress input through TEXT_NEWLINES_COUNT=300000.
Replace repeated wall-clock sampling of naming follow-ups with a bound on paragraphs serialized by each check. Keep 10,000-block documents, middle/end edits, repeated keystrokes and persisted block-id assertions.
Stop the simulated network once no updates remain after draining queued work; retain the existing follow-up delivery bound when work is pending. Reuse the fresh reader already checked by expectConverged in the normalization matrix. Take one JSON snapshot per fuzz peer per checkpoint and normalize only mismatches. All fuzz seeds, delivery schedules and checks remain.
## Test plan
### Before
A single-worker comparison of unchanged base tests and updated tests in the same invocation records:
| Suite | Base | Updated |
| --- | ---: | ---: |
| FollowUpCheckCost | 13.751 s | 4.357 s |
| NormalizationConvergence | 36.512 s | 25.272 s |
| TextNewlines | 34.068 s | 2.786 s |
All 2,312 before/after checks pass. These are local suite timings, not a claim about whole-workflow latency.
Temporarily disabling batching and forcing whole-container follow-up reads proves the replacements still detect those regressions:
```text
AssertionError: expected 20002 to be less than or equal to 12
RangeError: too many splitText arguments
Test Files 2 failed (2)
Tests 3 failed | 22 skipped (25)
```
### After
Restore the implementation, then run `pnpm run test-unit --maxWorkers=4 --reporter=json`:
```text
{'numPassedTests': 15310, 'numFailedTests': 0, 'success': True}
```
The pass count includes 16 expected-failure checks. The @lexical/y subset independently passes 4,967 checks, and a temporary comparison confirms identical findings and metrics from the original and updated fuzz checkpoint logic for 60 seeds.
TypeScript test checking, ESLint and formatting pass. Published implementation files and Yjs 13 bindings are unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
lexical
@lexical/a11y
@lexical/clipboard
@lexical/code
@lexical/code-core
@lexical/code-prism
@lexical/code-shiki
@lexical/compiler
@lexical/devtools-core
@lexical/dragon
@lexical/eslint-plugin
@lexical/extension
@lexical/fast-check
@lexical/file
@lexical/hashtag
@lexical/headless
@lexical/history
@lexical/html
@lexical/internal
@lexical/link
@lexical/list
@lexical/mark
@lexical/markdown
@lexical/mdast
@lexical/offset
@lexical/overflow
@lexical/plain-text
@lexical/react
@lexical/rich-text
@lexical/selection
@lexical/table
@lexical/tailwind
@lexical/text
@lexical/utils
@lexical/y
@lexical/yjs
commit: |
## Description
The migrated MaxLength emoji-boundary test dropped the 100 ms native typing delay used by its E2E predecessor. Firefox then leaves a non-collapsed DOM/model selection at offset 29 after rejecting the non-BMP character, and both rich-text and plain-text cases fail their caret assertions.
Forward an optional delay through the native browser typing helper and restore that delay for the rejected emoji. Other input keeps the zero-delay default. Preserve the content, Unicode-boundary, and collapsed-caret assertions.
## Test plan
### Before
Reproduced with the repository's Playwright 1.63.0 and Firefox 155 on Linux:
`VITEST_BROWSER=firefox pnpm exec vitest run --project browser packages/lexical-playground/src/__tests__/browser/MaxLength.test.ts --maxWorkers=1 --reporter=verbose`
```text
Test Files 1 failed (1)
Tests 2 failed | 8 passed (10)
```
Both failures report `isCollapsed: false` at offset 29 for the DOM and Lexical selections. Upstream CI shows the same failures on Linux, macOS, and Windows.
### After
Run the MaxLength and NativeTyping suites in Firefox 155:
```text
Test Files 2 passed (2)
Tests 12 passed (12)
```
The native-input lifecycle tests still verify that typing stays with its requesting editor and stops if that editor is removed. Local Firefox requires its sandbox disabled to create content processes in this environment.
ESLint, Prettier, TypeScript test checking, TypeScript scripts checking, and git diff --check pass. The full browser and platform matrix is being verified separately in CI.
This branch was successfully deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reduce test setup and repeated work across the unit, browser and E2E suites.
TEXT_NEWLINES_COUNT=300000.Three commits separate duplicate cleanup, browser migrations and Yjs test optimization. All changed files are tests or test helpers.
The audit found three tests whose bodies duplicated another case despite having different names. These corrections restore the coverage their names advertised:
LexicalBuilder: peer-firstpeer-firstandpeer-lastpassed(ExtensionA, ConfigExtension).peer-firstnow passes(ConfigExtension, ExtensionA), so the two cases exercise opposite orders.LexicalNode.insertAfter(): segmentedsetMode('token'), duplicating the token case.setMode('segmented').ListItemNode.insertNewAfter(): middle list itemlistItemNode3, duplicating the last-item case.listItemNode2; the expected DOM places the new item between “two” and “three”.These three corrections improve coverage accuracy; the runtime savings come from the removals, migrations and harness optimizations.
Test plan
Before
The five original E2E files pass against a development build with the default action delay:
They spend 58.24 seconds summed across test attempts.
A controlled single-worker invocation runs both base and updated versions of the three costly unit suites; all 2,312 checks pass:
These are local suite measurements, not a whole-CI latency claim.
Temporarily disabling batching and forcing whole-container follow-up reads makes the new checks fail for the intended reasons; the implementation was then restored:
After
pnpm run test-unit --maxWorkers=4 --reporter=json: 15,310 successful checks, including 16 expected failures; zero unexpected failures.pnpm run test-browser --maxWorkers=4 --reporter=json: 1,098 Chromium checks pass; zero failures.3 passed (3.8s)and3 passed (3.1s).Local engines were Chromium 141 and WebKit 26. WebKit validation used its matching driver without changing repository dependencies. Firefox cannot create its content process in this sandbox; validation against the repository's exact browser revisions and the full platform matrix remains for CI.