test(frontend): extend code-debugger and code-editor coverage#5191
Merged
Yicong-Huang merged 1 commit intoMay 24, 2026
Merged
Conversation
Add tests for the class-level surface area both specs were leaving behind. `code-debugger`: cover the Y.Map observer in registerBreakpointRenderingHandler (add / delete / hit-flip / condition-change branches), rerenderExistingBreakpoints, and the defined-and-undefined paths of removeMonacoBreakpointMethods. The spec used to build `debugState` from `new Y.Map<…>()` directly, which silently never fires observers because the map is not attached to a Y.Doc; switch to `new Y.Doc().getMap(…)` so observer-based assertions work. Line coverage rises 38% → 76%. `code-editor`: cover getFileSuffixByLanguage's full branch table, the onFocus highlight wiring, acceptCurrentAnnotation's no-op and suggestion-acceptance paths, rejectCurrentAnnotation's UI clearing and multi-variable continuation, and the AI-assistant gate. The Monaco-bound paths (initializeMonacoEditor's editor-bound subscribe body, initializeDiffEditor, setupAIAssistantActions' addAction callbacks) still need a real Monaco editor to run and are left for a future browser-mode pass. Line coverage rises 38% → 49%. Closes apache#5190
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5191 +/- ##
============================================
+ Coverage 44.54% 44.66% +0.11%
Complexity 2217 2217
============================================
Files 1042 1042
Lines 39989 39989
Branches 4260 4260
============================================
+ Hits 17814 17860 +46
+ Misses 21059 21012 -47
- Partials 1116 1117 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2 tasks
aglinxinyuan
approved these changes
May 24, 2026
5 tasks
aglinxinyuan
added a commit
to aglinxinyuan/texera
that referenced
this pull request
May 25, 2026
Conflicts in `frontend/package.json` and `frontend/yarn.lock` from two changes that landed on main after the last rebase: * `@lezer/python@1.1.18` was added in apache#5043 for the new Python UDF UI parameter form. Kept as-is — independent of the monaco upgrade. * `@codingame/monaco-vscode-{java,python}-default-extension` jumped from `8.0.4` (main) to `25.1.2` (PR side). Kept the PR side; that's the whole point of this branch. `r-default-extension` stays dropped per the PR's `What gets dropped` section. Knock-on: apache#5191 added unit tests on main that pin a `getFileSuffixByLanguage` private method and stub `editorWrapper` in the `acceptCurrentAnnotation` path. The v10 rewrite had inlined the suffix logic as a ternary at the two call sites and renamed `editorWrapper` -> `editorApp`. Restored the helper (cleaner anyway, and brings back `javascript` / case-insensitivity that the ternary silently dropped) and pointed the test stub at `editorApp` so both PRs' test surfaces stay green together. Verified on the merged tree: * `yarn install` clean (only the pre-existing monaco-breakpoints peer-dep warning, same as before the merge) * `yarn build` exits 0 * `yarn test --watch=false` -> 510 pass / 0 fail / 2 skip / 2 todo * `yarn lint` and `yarn format:ci` both clean
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.
What changes were proposed in this PR?
Extends the existing
code-debugger.component.spec.tsandcode-editor.component.spec.tswith tests for the class-level surface that the original specs left behind. No Monaco-editor interaction is added — the parts that require a real editor are left for a future browser-mode pass.A latent test-setup bug surfaced while writing the new debugger tests: the spec built
debugStatefromnew Y.Map<…>()directly, which silently never fires observers because the map is not attached to a Y.Doc. Production never hits this —UdfDebugServicehands out maps from a real doc — but every Y.Map observer test would have stayed at 0 coverage until the map was wired into a doc. Switching tonew Y.Doc().getMap(…)fixes it.Any related issues, documentation, discussions?
Closes #5190.
How was this PR tested?
yarn ng test --watch=false --include=…runs 2 spec files / 39 tests, all green.yarn lintandyarn format:ciboth clean.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7