Skip to content

fix(test): add textBetween/nodesBetween to plan-engine tr.doc mocks#2834

Merged
caio-pizzol merged 1 commit intomainfrom
caio/fix-plan-engine-mocks-word-diff
Apr 16, 2026
Merged

fix(test): add textBetween/nodesBetween to plan-engine tr.doc mocks#2834
caio-pizzol merged 1 commit intomainfrom
caio/fix-plan-engine-mocks-word-diff

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

The word-diff executor added in #2817 calls tr.doc.textBetween(...) and tr.doc.nodesBetween(...) in the text.rewrite trim path, but the tr.doc mocks in determinism-stress, executor, and preview-parity tests were never updated. That's been breaking `unit-tests (super-editor, 2/4)` and `(super-editor, 3/4)` on every PR since #2817 landed.

  • `determinism-stress.test.ts` — add `textBetween` + `nodesBetween` to `tr.doc`
  • `executor.test.ts` — same, parameterized on `text`
  • `preview-parity.test.ts` — add `nodesBetween` (`textBetween` was already there)
  • Verified locally: all 70 tests across the three files pass.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76f281c4bf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/superdoc/src/components/PdfViewer/PdfViewerPage.test.js
Comment thread packages/superdoc/src/core/whiteboard/WhiteboardPage.test.js
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Same root cause as the other three files — the word-diff trim in
executor.ts calls tr.doc.textBetween and charOffsetToDocPos (which
uses tr.doc.nodesBetween). The remap-length mock needs:
- textBetween returning a range-sized unique string (no common
  prefix/suffix with any replacement) so the trim is a no-op
- nodesBetween simulating a single text node so charOffsetToDocPos
  maps offsets correctly
@caio-pizzol caio-pizzol force-pushed the caio/fix-plan-engine-mocks-word-diff branch from c184165 to a60bc0b Compare April 16, 2026 01:33
@caio-pizzol caio-pizzol enabled auto-merge April 16, 2026 01:35
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 29c1a7a Apr 16, 2026
50 of 53 checks passed
@caio-pizzol caio-pizzol deleted the caio/fix-plan-engine-mocks-word-diff branch April 16, 2026 01:41
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.16

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.19

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in template-builder v1.5.0-next.19

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in esign v2.3.0-next.19

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in superdoc v1.26.0-next.19

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in superdoc-cli v0.7.0-next.20

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 16, 2026

🎉 This PR is included in superdoc-sdk v1.6.0-next.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants