Add Comprehensive Test Coverage for EducationalCurveTracker Component - #8328
Add Comprehensive Test Coverage for EducationalCurveTracker Component#8328nishupr wants to merge 1 commit into
Conversation
…mouse-interactivity, responsive-breakpoints test coverage Closes JhaSourav07#8324 - error-resilience: null on success:false, null on network error, null on non-Error throw, null on data:null, no crash on empty timeline, error boundary not triggered on valid data - empty-fallback: skeleton shown while loading, 2 skeleton blocks, skeleton disappears after load, empty timeline message, no bars when empty, null on data:null, null on success:false, Last 30 Days label - mouse-interactivity: one bar per timeline entry, hover classes on bars, tooltip commit count, tooltip date, group-hover:block on tooltip, hover lift on card 1 and card 2 - responsive-breakpoints: grid-cols-1 md:grid-cols-3, gap-6, col-span-1, col-span-2, max-w-7xl padding, skeleton grid and span classes
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request significantly improves the test coverage for the EducationalCurveTracker component, ensuring it handles various scenarios effectively. This aligns with our previous decision to add comprehensive test variants for this component to prevent regressions. Thank you for your contribution, and I look forward to your updates! |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Comprehensive test coverage for EducationalCurveTracker — empty fallback, error resilience, mouse interactivity, and responsive breakpoints. Well structured across 4 test files. CI failing, please fix.
Labels: level:intermediate (4 files, 570 lines), quality:clean, type:testing, mentor:Aamod007
Aamod007
left a comment
There was a problem hiding this comment.
Re-reviewing after noting the only CI failure is Vercel authorization (not code-related). All other checks (Format · Lint · Typecheck · Test, Production Build, CodeQL) pass. Approving — the Vercel deploy auth is a repo-level config issue, not a code problem.
Summary
Closes #8324
EducationalCurveTracker.tsxwas added in the latest upstream merge with only a basic.test.tsxand a single.accessibility.test.tsx. This PR adds the 4 missing test variants to bring it in line with the full test matrix every other dashboard component follows.Test Files Added
EducationalCurveTracker.error-resilience.test.tsx- 7 testsnullwhen API returnssuccess: falsenullwhen API returnssuccess: falsewith no error messagenullwhen a network error is thrownnullwhen fetch throws a non-Error exception (e.g. string)timelineis an empty arraynullwhendataisnulldespitesuccess: trueEducationalCurveTracker.empty-fallback.test.tsx- 8 testsanimate-pulseskeleton while data is being fetchedtimelineis emptytimelineis emptynullwhendataisnullafter a successful responsenullwhensuccessisfalseEducationalCurveTracker.mouse-interactivity.test.tsx- 10 testshover:bg-indigo-400,transition-colors, andgroupclassesgroup-hover:blockclass (hidden by default)hover:-translate-y-1andtransition-transformclasseshover:-translate-y-1andtransition-transformclassesEducationalCurveTracker.responsive-breakpoints.test.tsx- 9 testsgrid-cols-1andmd:grid-cols-3classesgap-6classcol-span-1col-span-2max-w-7xland responsive padding (px-4,sm:px-6,lg:px-8)grid-cols-1 md:grid-cols-3layoutcol-span-1col-span-2Checklist
.test.tsxand 1 in.accessibility.test.tsx)global.fetchmocked viavi.fn()consistent with existingEducationalCurveTracker.test.tsxmain