test(frontend): rewrite sync-texera-model spec#5194
Merged
Yicong-Huang merged 2 commits intoMay 24, 2026
Conversation
The spec carried four commented-out `it()` blocks at lines 148, 200,
602, and 687, each calling a three-argument `SyncTexeraModel`
constructor that took an `OperatorGroup` as the third dependency.
`OperatorGroup` has long been removed from the codebase, the
constructor is now two-arg, and `SyncTexeraModel` itself no longer
handles operator-delete events at all — every commented test depended
on a dependency that's gone and tested a responsibility that's been
refactored elsewhere. A nearby live test ("should explicitly throw an
error if the JointJS operator delete event deletes a nonexist
operator") was vacuous: its body never instantiated the SUT and
asserted nothing.
Drop the four commented blocks, their preceding doc blocks, the
vacuous live test, and the now-orphan `getJointOperatorValue` helper.
Add a `describe("getOperatorLink", …)` block that exercises the two
`throw` branches inside the static helper, which the stream-handler
tests can't reach because `isValidJointLink` filters those cases out
upstream. SUT coverage rises from 94 % (31/33) to 100 % (33/33); the
spec shrinks 747 → 449 lines.
Closes apache#5193
Prettier's 120-char printWidth wraps the `expect().toThrow()` lines once the SUT name is the longer `SyncTexeraModel.getOperatorLink`. My earlier local format check piped through `tail`, which masked prettier-eslint's non-zero exit; CI caught it. No behaviour change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5194 +/- ##
============================================
+ Coverage 45.25% 45.38% +0.12%
Complexity 2216 2216
============================================
Files 1042 1042
Lines 39989 39989
Branches 4260 4260
============================================
+ Hits 18099 18149 +50
+ Misses 20770 20721 -49
+ Partials 1120 1119 -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:
|
aglinxinyuan
approved these changes
May 24, 2026
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?
sync-texera-model.spec.tswas carrying ~344 lines of dead test code: fourit()blocks commented out against aSyncTexeraModelconstructor that took anOperatorGroupthird argument.OperatorGroupwas removed from the codebase long ago, the constructor is now two-arg, andSyncTexeraModelno longer handles operator-delete events at all — so each commented test depended on a class that doesn't exist and exercised behavior that's been moved elsewhere. One nearby live test claimed to assert the operator-delete error path but never instantiated the SUT and made no assertions; it was vacuous.Drop the four commented blocks, their preceding doc blocks, the vacuous live test, and the now-orphaned
getJointOperatorValuehelper. Add adescribe("getOperatorLink", …)that hits the static helper's twothrowbranches directly — the stream-handler tests can't reach them becauseisValidJointLinkfilters those cases out upstream.Any related issues, documentation, discussions?
Closes #5193.
How was this PR tested?
yarn ng test --watch=false --include=…runs 9 tests, all green.yarn lintandyarn format:ciboth clean. v8 line coverage ofsync-texera-model.tsrises from 94 % (31/33) to 100 % (33/33); the spec itself shrinks 747 → 449 lines.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7