test(frontend): add unit tests for serializePortIdentity - #6938
Open
rbelavadi wants to merge 2 commits into
Open
test(frontend): add unit tests for serializePortIdentity#6938rbelavadi wants to merge 2 commits into
rbelavadi wants to merge 2 commits into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6938 +/- ##
============================================
+ Coverage 77.30% 82.91% +5.60%
============================================
Files 1161 328 -833
Lines 45922 20135 -25787
Branches 5101 2905 -2196
============================================
- Hits 35501 16695 -18806
+ Misses 8840 2775 -6065
+ Partials 1581 665 -916
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @Ma77Ball |
xuang7
enabled auto-merge
July 27, 2026 20:44
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?
Adds
port-identity-serde.spec.tsto coverserializePortIdentity, a previously untested pure utility function incommon/util/that serializes aPortIdentityinto the stable string keyid_internal.This format is one half of a cross-language contract: the backend produces the identical string in
PortIdentityKeySerializer.portIdToStringand reads it back by splitting on"_"inPortIdentityKeyDeserializer. A format mismatch on either side would cause the frontend's schema lookup to silently returnundefinedrather than fail, so the exact output is worth pinning.Covers four groups of behavior:
id: 0falsy-number boundary and large and negative ids passing through unvalidated. These mirrorPortIdentityKeySerializerSpec.scala's case table exactly, so both ends of the contract are now pinned by matching assertions.id, or only byinternal, cannot collide on the same key.No production code was changed.
Any related issues, documentation, discussions?
Closes #6631
How was this PR tested?
Added 12 new unit tests in
port-identity-serde.spec.tscovering all behavior described in the issue. Ran locally viang test --include src/app/common/util/port-identity-serde.spec.ts --watch=false; all 12 pass. Full suite also green viayarn test(3817 passed, 2 skipped, 198 files).Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)