Skip to content

test(HistoricalTrendView): add empty-fallback edge case tests#5740

Open
Mahi11Patel wants to merge 2 commits into
JhaSourav07:mainfrom
Mahi11Patel:test/historical-trend-view-empty-fallback
Open

test(HistoricalTrendView): add empty-fallback edge case tests#5740
Mahi11Patel wants to merge 2 commits into
JhaSourav07:mainfrom
Mahi11Patel:test/historical-trend-view-empty-fallback

Conversation

@Mahi11Patel

Copy link
Copy Markdown

Description

Fixes #4255

This PR adds the missing test file components/dashboard/HistoricalTrendView.empty-fallback.test.tsx as required by the issue.

The test file covers 5 edge cases for the HistoricalTrendView component when activity data is empty or missing:

  • Renders without crashing when activity is an empty array
  • Shows zero for all stats (contributions, active days, streak) on an empty dataset
  • Displays the no-streak-data fallback message when activity is empty
  • Displays monthly and yearly empty-state messages when there is no activity
  • Renders the period label and navigation controls even with no activity data

All 5 tests pass with vitest run.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

N/A — test file only, no SVG changes

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
image

@Mahi11Patel

Copy link
Copy Markdown
Author

Hi @JhaSourav07 ,
I've completed this PR and all CI checks are passing. When you have time, could you please review it? Thank you!

@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 3433.84 KB 3433.84 KB 0 B
Total CSS 258.05 KB 258.05 KB 0 B

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:testing Adding, updating, or fixing tests mentor:Aamod007 gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 15, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 15, 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.

Good fallback coverage here. The updated components/dashboard/HistoricalTrendView.empty-fallback.test.tsx and the new components/AnimatedCursor.empty-fallback.test.tsx cover the empty activity state, period/navigation controls, and cursor fallback behavior without changing production code, so this is a clean test-only addition.

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

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points level:beginner Small changes Usually isolated fixes or simple UI/text updates. 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.

test(HistoricalTrendView-empty-fallback): verify Edge Cases & Empty/Missing Inputs Verification (Variation 1)

2 participants