Skip to content

test(ui): verify responsive rendering and elements of HeroSection (Variation 1)#5763

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
RavindiFernando:test/hero-section-responsive
Jun 15, 2026
Merged

test(ui): verify responsive rendering and elements of HeroSection (Variation 1)#5763
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
RavindiFernando:test/hero-section-responsive

Conversation

@RavindiFernando

Copy link
Copy Markdown
Contributor

Description

Adds a Variation 1 test suite to app/components/HeroSection.test.tsx with 5 tests verifying the component's layout structure and typography across responsive viewports (375 px, 768 px, 1280 px). Tests assert the role="region" container, H1 gradient classes (text-5xl, font-extrabold, bg-clip-text, light and dark gradient stops), and correct HTML node types for the input and buttons. Uses matchMedia stubbing to simulate viewports.

Fixes #1517

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

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.

Copilot AI review requested due to automatic review settings June 15, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new test suite for HeroSection Variation 1 to validate responsive rendering, accessibility roles/labels, and key UI elements across viewport widths.

Changes:

  • Added a matchMedia stub helper to simulate viewport breakpoints in tests.
  • Added assertions for hero region accessibility, heading semantics/typography classes (including dark-mode gradients), and presence of form controls/buttons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +117 to +123
vi.fn().mockImplementation((query: string) => {
const minMatch = query.match(/\(min-width:\s*(\d+)px\)/);
const maxMatch = query.match(/\(max-width:\s*(\d+)px\)/);
let matches = false;
if (minMatch) matches = width >= Number(minMatch[1]);
else if (maxMatch) matches = width <= Number(maxMatch[1]);
return {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread app/components/HeroSection.test.tsx Outdated
Comment on lines +137 to +145
it('outer container carries the hero region role and aria-label', () => {
setupMatchMedia(1280);
render(<HeroSection />);
const region = screen.getByRole('region', { name: /hero section/i });
expect(region).toBeInTheDocument();
expect(region.tagName).toBe('DIV');
expect(region.className).toContain('bg-[radial-gradient');
vi.unstubAllGlobals();
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread app/components/HeroSection.test.tsx Outdated
Comment on lines +142 to +143
expect(region.tagName).toBe('DIV');
expect(region.className).toContain('bg-[radial-gradient');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@RavindiFernando RavindiFernando force-pushed the test/hero-section-responsive branch from 8c36bc8 to 8a5f47c Compare June 15, 2026 13:43
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 15, 2026
@RavindiFernando RavindiFernando force-pushed the test/hero-section-responsive branch from 1d68d94 to 41b77a1 Compare June 15, 2026 13:48
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

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.75 KB 3433.75 KB 0 B
Total CSS 258.05 KB 258.05 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 type:design UI designs, styling, SVG icons, and themes gssoc:approved PR has been reviewed and accepted for valid contribution points labels 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.

Thanks for the HeroSection responsive coverage. I reviewed the PR title/description, linked issue #1517, checks, and the actual diff before labeling.

Labels applied:

  • level:intermediate: this is an 80-line augmentation to an existing test file, app/components/HeroSection.test.tsx, adding viewport stubbing, role checks, and typography assertions in lines 112-193.
  • quality:clean: the matchMedia stub is isolated in a helper, globals are cleaned up in afterEach, and the assertions stay close to the actual hero markup and class names.
  • type:testing: the PR adds responsive and accessibility-oriented testing for HeroSection, which is exactly what issue #1517 asked for.
  • type:design: the assertions cover layout and gradient typography classes across breakpoints, so the change is directly about visual treatment as well as behavior.

All required checks are green and the PR is not draft or blocked, so I’m approving and adding gssoc:approved.

@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 15, 2026
@JhaSourav07 JhaSourav07 merged commit 2213168 into JhaSourav07:main Jun 15, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @RavindiFernando! 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:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:design UI designs, styling, SVG icons, and themes type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ui): verify responsive rendering and elements of HeroSection (Variation 1)

4 participants