Skip to content

Commit 6405fad

Browse files
authored
test(ui): add responsive rendering tests for HeroSection (JhaSourav07#1660)
## Description Adds a new test suite `HeroSection responsive rendering and typography (Variation 3)` to `app/components/HeroSection.test.tsx` verifying the HeroSection component renders full typography headings, stat badges, input fields, and action buttons correctly. Fixes JhaSourav07#1537 ## Pillar - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors. - [x] My commits follow the Conventional Commits format. - [x] I have made sure that i have only one commit to merge in this PR.
2 parents 4a2ad4f + 3c557ca commit 6405fad

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

app/components/HeroSection.test.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,42 @@ describe('HeroSection', () => {
4848
expect(screen.getByText(/isometric/i).textContent).toMatch(/isometric/i);
4949
});
5050
});
51+
52+
describe('HeroSection responsive rendering and typography (Variation 3)', () => {
53+
it('renders full typography heading with high contrast gradient', () => {
54+
render(<HeroSection />);
55+
const heading = screen.getByRole('heading', { level: 1 });
56+
expect(heading).toBeDefined();
57+
expect(heading.className).toMatch(/text-5xl|text-8xl|font-extrabold/);
58+
});
59+
60+
it('renders all three stat badges', () => {
61+
render(<HeroSection />);
62+
expect(screen.getByText(/1,247 Contributions/i)).toBeDefined();
63+
expect(screen.getByText(/83 Pull Requests/i)).toBeDefined();
64+
expect(screen.getByText(/214 Commits/i)).toBeDefined();
65+
});
66+
67+
it('renders GitHub username input field', () => {
68+
render(<HeroSection />);
69+
const input = screen.getByPlaceholderText(/Enter GitHub Username/i);
70+
expect(input).toBeDefined();
71+
});
72+
73+
it('renders Watch Dashboard button', () => {
74+
render(<HeroSection />);
75+
const button = screen.getByText(/Watch Dashboard/i);
76+
expect(button).toBeDefined();
77+
});
78+
79+
it('renders Copy Link button', () => {
80+
render(<HeroSection />);
81+
const button = screen.getByText(/Copy Link/i);
82+
expect(button).toBeDefined();
83+
});
84+
85+
it('renders descriptive paragraph with professional precision text', () => {
86+
render(<HeroSection />);
87+
expect(screen.getByText(/professional precision/i)).toBeDefined();
88+
});
89+
});

0 commit comments

Comments
 (0)