Skip to content

Commit 4c921d7

Browse files
authored
test: add timezone boundary coverage for WallOfLove (JhaSourav07#3416)
## Description Fixes JhaSourav07#2780 Added `components/WallOfLove.timezone-boundaries.test.tsx` to improve coverage for timezone-boundary equivalent scenarios in the WallOfLove component. ### Changes made * Added 5 boundary-focused test cases * Verified reduced-motion rendering behavior * Verified testimonial visibility and alignment across marquee rendering * Verified statistics continuity rendering * Verified avatar-to-author mapping integrity * Verified testimonial content preservation across render boundaries ## Pillar * [ ] 🎨 Pillar 1 — New Theme Design * [ ] 📐 Pillar 2 — Geometric SVG Improvement * [x] 🕐 Pillar 3 — Timezone Logic Optimization * [ ] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only change) ## Checklist before requesting a review: * [x] I have read the `CONTRIBUTING.md` file. * [x] I have tested these changes locally. * [x] My commits follow the Conventional Commits format. * [x] I have made sure that I have only one commit to merge in this PR. * [ ] I have run `npm run format` and `npm run lint` locally and resolved all errors. * [ ] I have updated `README.md` if I added a new theme or URL parameter. * [ ] I have started the repo. * [ ] The SVG output matches the CommitPulse premium quality aesthetic standard. * [x] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 79fd331 + 3ce0f08 commit 4c921d7

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { render, screen } from '@testing-library/react';
2+
import '@testing-library/jest-dom/vitest';
3+
import { describe, expect, it, vi } from 'vitest';
4+
import { WallOfLove } from './WallOfLove';
5+
6+
// Mock framer-motion
7+
vi.mock('framer-motion', () => ({
8+
motion: {
9+
p: (props: React.ComponentProps<'p'>) => <p {...props} />,
10+
},
11+
useReducedMotion: () => true,
12+
}));
13+
14+
// Mock gsap
15+
vi.mock('gsap', () => {
16+
const timeline = () => ({
17+
to: vi.fn(),
18+
fromTo: vi.fn(),
19+
kill: vi.fn(),
20+
});
21+
22+
return {
23+
default: {
24+
registerPlugin: vi.fn(),
25+
context: (cb: () => void) => {
26+
cb();
27+
return { revert: vi.fn() };
28+
},
29+
timeline,
30+
to: vi.fn(),
31+
set: vi.fn(),
32+
},
33+
};
34+
});
35+
36+
vi.mock('gsap/ScrollTrigger', () => ({
37+
ScrollTrigger: {},
38+
}));
39+
40+
describe('WallOfLove - Timezone Boundaries', () => {
41+
it('Reduced Motion Boundary (UTC Equivalent): renders content when motion reduction is enabled', () => {
42+
render(<WallOfLove />);
43+
44+
expect(screen.getByText('Happy Developers')).toBeInTheDocument();
45+
expect(screen.getByText('Badges Generated')).toBeInTheDocument();
46+
expect(screen.getByText('Average Rating')).toBeInTheDocument();
47+
});
48+
49+
it('Visual Alignment Boundary (Calendar Date Alignment Equivalent): preserves testimonial visibility across marquee boundaries', () => {
50+
render(<WallOfLove />);
51+
52+
expect(screen.getAllByText('Alex Chen').length).toBeGreaterThan(0);
53+
expect(screen.getAllByText('Priya Sharma').length).toBeGreaterThan(0);
54+
expect(screen.getAllByText('David Kim').length).toBeGreaterThan(0);
55+
});
56+
57+
it('Stats Continuity Boundary (Leap Year Equivalent): renders all statistic values without gaps', () => {
58+
render(<WallOfLove />);
59+
60+
expect(screen.getByText('2K+')).toBeInTheDocument();
61+
expect(screen.getByText('50K+')).toBeInTheDocument();
62+
expect(screen.getByText('4.9')).toBeInTheDocument();
63+
});
64+
65+
it('Avatar Mapping Boundary (Timezone Offset Equivalent): preserves avatar-to-author associations', () => {
66+
render(<WallOfLove />);
67+
68+
const avatar = screen.getAllByAltText('Alex Chen')[0];
69+
70+
expect(avatar).toBeInTheDocument();
71+
expect(avatar).toHaveAttribute('src');
72+
expect(avatar.getAttribute('src')).toContain('Alex');
73+
});
74+
75+
it('Content Preservation Boundary (Calendar Grid Integrity Equivalent): preserves testimonial message content across render boundaries', () => {
76+
render(<WallOfLove />);
77+
78+
const messages = screen.getAllByText(
79+
/Just added CommitPulse to my GitHub README and the 3D monolith looks absolutely insane/i
80+
);
81+
82+
expect(messages.length).toBeGreaterThan(0);
83+
});
84+
});

0 commit comments

Comments
 (0)