test(achievements): add timezone normalization boundary tests#5958
test(achievements): add timezone normalization boundary tests#5958udaycodespace wants to merge 2 commits into
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
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.