Commit e5d01d1
committed
platform: data-driven selection tests for USJ <-> Lexical conversion
Add 612 data-driven tests (136 USJ locations x 3 marker modes + round-trips)
for selection resolution and round-trip conversion between USJ document
locations and Lexical editor selections.
Test data:
- 2sa.usj-locations.ts: 136 location entries adapted from paranext-core's
testUSFM-2SA-1-locations.ts covering all 7 UsjDocumentLocation subtypes
- 2sa.lexical.{editable,visible,hidden}.ts: pre-generated serialized Lexical
editor states for `usj2Sa` in each marker mode
Known implementation gaps are tracked with `expect(() => ...).toThrow()`
inside regular `it()` tests so they stay visible without breaking CI or
the VS Code test explorer. When a gap is fixed the `toThrow()` assertion
fails, prompting removal of the entry from the KNOWN_*_GAPS set.
Generation:
- generate-2sa-lexical-states.test.ts guarded by GENERATE_TEST_DATA env var
(skipped during normal nx test runs)
- pnpm generate:test-data in packages/platform to regenerate fixtures
Also adds test-data as a devDependency of shared-react and excludes the
auto-generated Lexical state fixtures from SonarLint analysis.1 parent 9f09780 commit e5d01d1
File tree
16 files changed
+27627
-4
lines changed- .vscode
- demos/platform/src/app
- libs
- test-data
- src/data
- packages/platform
- src/editor/adaptors
16 files changed
+27627
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
Lines changed: 545 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
0 commit comments