test(Common): cover isOverrideApplicable and getOverrideMeta in UserOverrideUtil#2581
Open
suvvvv wants to merge 1 commit into
Open
test(Common): cover isOverrideApplicable and getOverrideMeta in UserOverrideUtil#2581suvvvv wants to merge 1 commit into
suvvvv wants to merge 1 commit into
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The existing UserOverrideUtil suite exercises applyOverridesToEvents thoroughly but never calls isOverrideApplicable or getOverrideMeta directly. Add focused coverage for those two public methods: - isOverrideApplicable: global overrides (no policy id) always apply; policy-scoped overrides apply only to their own policy and never without a policy context. - getOverrideMeta: null for a plain event, the meta for a segment produced by a substitution, and null when the marker is present but isOverride is not true. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7fa23db to
5812980
Compare
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
The existing
UserOverrideUtilsuite exercisesapplyOverridesToEventsthoroughly, but never callsisOverrideApplicableorgetOverrideMetadirectly. This adds focused coverage for those two public methods, on top of the existing tests.isOverrideApplicable— global overrides (no policy id) always apply; policy-scoped overrides apply only to their own policy, and never without a policy context.getOverrideMeta—nullfor a plain event, the meta for a segment produced by a substitution (assertingoriginalUserId/overrideUserId), andnullwhen the marker is present butisOverrideisn'ttrue.Note
This PR originally added a separate test file, which collided with the suite added on master in the meantime. It has been rebased onto master and reduced to purely additive tests — the existing 10 tests are untouched, and only the two previously-uncovered public methods are added.
Testing
16 tests pass (10 existing + 6 new). Prettier- and eslint-clean.