Skip to content

Add Unit Tests for Heatmap Mouse Interactivity and Tooltips#8266

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:test/heatmap-mouse-interactivity
Jul 23, 2026
Merged

Add Unit Tests for Heatmap Mouse Interactivity and Tooltips#8266
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:test/heatmap-mouse-interactivity

Conversation

@tamilr0727-ux

Copy link
Copy Markdown
Contributor

Description

Adds mouse interaction and tooltip behavior test coverage for components/dashboard/Heatmap.tsx through the new test file components/dashboard/Heatmap.mouse-interactivity.test.tsx.

Changes

  • Added tests simulating mouse hover, pointer movement, and touch interactions on interactive heatmap cells.
  • Verified responsive tooltip rendering and positioning based on user interaction coordinates.
  • Tested click and touch event propagation to ensure interactions trigger the expected callbacks.
  • Confirmed interactive elements expose appropriate cursor styles during hover.
  • Validated tooltip dismissal and overlay cleanup on mouse leave events.

Test Coverage

Implemented 5 test cases covering:

  1. Mouse enter and hover interactions on active heatmap cells.
  2. Responsive tooltip rendering with correct positioning and visibility.
  3. Click and touch gesture propagation triggering expected event handlers.
  4. Pointer cursor styling applied to interactive heatmap elements.
  5. Mouse leave behavior hiding temporary tooltip and overlay elements.

Validation

  • All tests pass successfully with vitest run.
  • Mouse and touch interactions are fully mocked for deterministic execution.
  • No production code changes required.
  • Improves confidence that interactive heatmap behavior remains stable across future updates.

Verification

vitest run passes successfully.

Fixes #2557

Pillar

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

Visual Preview

Can Check in the Files Changed Section.

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.

@retenta-bot

retenta-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

This PR enhances the test coverage for the Heatmap component by adding unit tests that simulate mouse and touch interactions, ensuring that tooltips and event handling work as expected. This is similar to previous decisions made regarding responsive layout tests for mobile devices, which aimed to validate rendering behavior across different screen sizes. Improving test coverage in this way helps maintain confidence in the component's stability. Thank you for your contributions!

@retenta-bot retenta-bot Bot changed the title test(Heatmap): add unit tests for mouse interactivity, tooltips, and touch events Add Unit Tests for Heatmap Mouse Interactivity and Tooltips Jul 22, 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 3984.83 KB 3984.83 KB 0 B
Total CSS 331.41 KB 331.41 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 labels Jul 23, 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.

Thanks for adding these test cases! It's always great to have comprehensive coverage for interactive UI components like the Heatmap tooltips. The tests correctly mock the necessary context and observer APIs.

This is a clean and straightforward addition. Great job!

Label Justification:

  • \level:beginner: Adding a single test file falls under the beginner category.
  • \quality:clean: Well-structured tests with proper mocking and assertions.
  • \ ype:testing: Purely adds unit tests for existing functionality.
  • \mentor:Aamod007: Assigned as required.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jul 23, 2026
@JhaSourav07
JhaSourav07 merged commit b0c6a37 into JhaSourav07:main Jul 23, 2026
10 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @tamilr0727-ux! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

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(Heatmap-mouse-interactivity): verify Interactive Tooltips, Cursor Hovers & Touch Event Propagation (Variation 5)

3 participants