test(achievements): add timezone normalization boundary tests#5958
Conversation
e7af59c to
f9c67f5
Compare
|
Labels Applied:
Justification: Status: Blocked |
f9c67f5 to
3bfa41b
Compare
Thanks for the review. I've addressed the failing TypeScript issues in Verification completed locally: npx prettier --write components/dashboard/Achievements.timezone-boundaries.test.tsx
npx vitest run components/dashboard/Achievements.timezone-boundaries.test.tsxResult: Changes have been pushed to the PR branch ( |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
There was a problem hiding this comment.
Reviewed the test file. A few things to clean up:
-
process.env reassignment (Achievements.timezone-boundaries.test.tsx): Reassigning process.env with a plain object { ...originalEnv } can break Node internals. The rest of the codebase saves/restores just process.env.TZ — follow that pattern instead.
-
Test 5 'DST boundary' doesn't actually cross DST: 2024-03-10T01:59:59Z is ~10h before US Eastern spring-forward. Adding 1h still doesn't cross the transition. Pick a time that genuinely spans it (e.g. 2024-03-10T06:59:59Z + 1s) or drop 'DST' from the test name.
-
Tests don't exercise timezone paths: The Achievements component renders static props and doesn't use any timezone API. These tests verify vitest mechanics, not timezone behavior. If the intent is future-proofing, mention that in the PR description.
Minor: the �i.mock('framer-motion') passes animation props to
Aamod-Dev
left a comment
There was a problem hiding this comment.
Review
This PR cannot be approved in its current state due to blocking issues (status:blocked label, merge conflicts, needs-rebase label, and/or failing CI checks). Please resolve the blocking issues and re-request review.
Once unblocked, I'm happy to re-review! 💚
|
Hi @Aamod-Dev, Addressed the review comments and updated the tests to focus on actual component behavior. Verified locally:
Pushed the changes. Please take another look when you get a chance. |
c9394a1 to
4789746
Compare
Aamod-Dev
left a comment
There was a problem hiding this comment.
These timezone boundary tests are crucial for an application that relies heavily on date rendering. Testing across UTC, EST, IST, and JST, along with leap year boundaries, ensures that the Achievements component remains perfectly stable for all users regardless of their locale. Approved!
|
🎉 Congratulations @udaycodespace! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Description
Fixes #2480
Added
Achievements.timezone-boundaries.test.tsxto verify Timezone Normalization & Calendar Data Boundary Alignment scenarios for the Achievements component.Added Coverage
Verification
Test File
Output:
Existing Component Tests
Output:
Pillar
Visual Preview
N/A (test-only change)
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors.README.mdif I added a new theme or URL parameter.