test(utils): consolidate scattered oneHundredToFraction assertions#7443
Open
Harshit-Mishra2212 wants to merge 1 commit into
Open
Conversation
Contributor
|
🧪 Jest Test Results ✅ All Jest tests passed! This PR is ready to merge. Coverage: Statements: 48.09% | Branches: 39.61% | Functions: 52.88% | Lines: 48.49% |
mahesh-09-12
left a comment
Contributor
There was a problem hiding this comment.
Thanks for following up on the maintainability concern - my earlier suggestion was mainly about the duplicated assertions, but consolidating the scattered blocks also looks cleaner overall.
Collaborator
|
-Could you update the title/description to reflect that |
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.
Description
Following a suggestion by @mahesh-09-12 on #7431 , this PR consolidates the four scattered
oneHundredToFraction()describe blocks inutils.test.jsinto a single, cohesive block for easier maintenance.Before this change, assertions for the same function were spread across:
describe("oneHundredToFraction()")describe("oneHundredToFraction()")inside theformat() function logicblock (exact duplicate of above)describe("oneHundredToFraction() more cases")describe("oneHundredToFraction() exhaustive branch coverage")All unique assertions are preserved in one consolidated
describe("oneHundredToFraction()")block. No assertions were removed except the exact duplicate one.Related Issue
Follows from reviewer suggestion on #7431 .
PR Category
Changes Made
js/utils/__tests__/utils.test.js: merge 4 scattered describe blocks into one; remove exact duplicate block; preserve all unique assertionsTesting Performed
npm test -- utils.test.js— all tests passnpm test— no regressions introducedChecklist
npm run lintandnpx prettier --check .with no errors.Additional Notes for Reviewers
No production code was changed; only
utils.test.jsis touched. All 18 unique test values are preserved in the consolidated block.