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 78.96% 78.50% -0.46%
+ Complexity 3798 3715 -83
============================================
Files 1161 1161
Lines 46084 46036 -48
Branches 5110 5102 -8
============================================
- Hits 36388 36139 -249
- Misses 8076 8291 +215
+ Partials 1620 1606 -14
*This pull request uses carry forward flags. Click here to find out more. ☔ 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
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 27, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 27, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Jul 28, 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?
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)