Skip to content

Add Comprehensive Test Coverage for EducationalCurveTracker Component - #8328

Open
nishupr wants to merge 1 commit into
JhaSourav07:mainfrom
nishupr:feat/educational-curve-tracker-tests
Open

Add Comprehensive Test Coverage for EducationalCurveTracker Component#8328
nishupr wants to merge 1 commit into
JhaSourav07:mainfrom
nishupr:feat/educational-curve-tracker-tests

Conversation

@nishupr

@nishupr nishupr commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #8324

EducationalCurveTracker.tsx was added in the latest upstream merge with only a basic .test.tsx and 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 tests

  • Renders null when API returns success: false
  • Renders null when API returns success: false with no error message
  • Renders null when a network error is thrown
  • Renders null when fetch throws a non-Error exception (e.g. string)
  • Does not crash when timeline is an empty array
  • Renders null when data is null despite success: true
  • Survives being wrapped in an error boundary without triggering it on valid data

EducationalCurveTracker.empty-fallback.test.tsx - 8 tests

  • Shows animate-pulse skeleton while data is being fetched
  • Skeleton contains exactly 2 placeholder blocks
  • Skeleton disappears after data loads
  • Shows "No educational commits in the recent window." when timeline is empty
  • Does not render any bar columns when timeline is empty
  • Renders null when data is null after a successful response
  • Renders null when success is false
  • Renders "Last 30 Days" label in the chart card header

EducationalCurveTracker.mouse-interactivity.test.tsx - 10 tests

  • Renders exactly one bar column per timeline entry
  • Bar columns have hover:bg-indigo-400, transition-colors, and group classes
  • Tooltip renders commit count for each bar
  • Tooltip renders date for each bar
  • Tooltip container has group-hover:block class (hidden by default)
  • Card 1 has hover:-translate-y-1 and transition-transform classes
  • Card 2 has hover:-translate-y-1 and transition-transform classes

EducationalCurveTracker.responsive-breakpoints.test.tsx - 9 tests

  • Outer grid has grid-cols-1 and md:grid-cols-3 classes
  • Outer grid has gap-6 class
  • Card 1 (Current Focus) uses col-span-1
  • Card 2 (Syllabus Momentum) uses col-span-2
  • Wrapper has max-w-7xl and responsive padding (px-4, sm:px-6, lg:px-8)
  • Loading skeleton uses same grid-cols-1 md:grid-cols-3 layout
  • Skeleton card 1 uses col-span-1
  • Skeleton card 2 uses col-span-2

Checklist

  • All 34 tests pass locally (includes existing 3 tests in .test.tsx and 1 in .accessibility.test.tsx)
  • global.fetch mocked via vi.fn() consistent with existing EducationalCurveTracker.test.tsx
  • No changes to production code
  • Branch created off main

…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
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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.

@retenta-bot

retenta-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

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!

@retenta-bot retenta-bot Bot changed the title test(EducationalCurveTracker): add error-resilience, empty-fallback, mouse-interactivity, and responsive-breakpoints test coverage Add Comprehensive Test Coverage for EducationalCurveTracker Component Jul 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4052.50 KB 4052.50 KB 0 B
Total CSS 338.94 KB 338.94 KB 0 B

@Aamod007 Aamod007 added level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. mentor:Aamod007 type:testing Adding, updating, or fixing tests labels Jul 27, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing test variants for EducationalCurveTracker component

2 participants