|
| 1 | +import { render, screen } from '@testing-library/react'; |
| 2 | +import { describe, expect, it, vi } from 'vitest'; |
| 3 | +vi.mock('gsap', () => ({ |
| 4 | + default: { |
| 5 | + registerPlugin: vi.fn(), |
| 6 | + context: vi.fn((cb) => { |
| 7 | + cb(); |
| 8 | + return { |
| 9 | + revert: vi.fn(), |
| 10 | + }; |
| 11 | + }), |
| 12 | + timeline: vi.fn(() => ({ |
| 13 | + fromTo: vi.fn(), |
| 14 | + to: vi.fn(), |
| 15 | + kill: vi.fn(), |
| 16 | + })), |
| 17 | + set: vi.fn(), |
| 18 | + to: vi.fn(), |
| 19 | + }, |
| 20 | +})); |
| 21 | +vi.mock('gsap/ScrollTrigger', () => ({ |
| 22 | + ScrollTrigger: {}, |
| 23 | +})); |
| 24 | +import { WallOfLove } from './WallOfLove'; |
| 25 | +import '@testing-library/jest-dom/vitest'; |
| 26 | + |
| 27 | +describe('WallOfLove', () => { |
| 28 | + it('renders the Wall of Love heading', () => { |
| 29 | + render(<WallOfLove />); |
| 30 | + |
| 31 | + expect(screen.getByText(/Wall of/i)).toBeInTheDocument(); |
| 32 | + }); |
| 33 | + it('renders the developer feedback text', () => { |
| 34 | + render(<WallOfLove />); |
| 35 | + |
| 36 | + expect( |
| 37 | + screen.getByText(/See what developers are saying about CommitPulse/i) |
| 38 | + ).toBeInTheDocument(); |
| 39 | + }); |
| 40 | + it('renders the statistics section', () => { |
| 41 | + render(<WallOfLove />); |
| 42 | + |
| 43 | + expect(screen.getByText('Happy Developers')).toBeInTheDocument(); |
| 44 | + expect(screen.getByText('Badges Generated')).toBeInTheDocument(); |
| 45 | + expect(screen.getByText('Average Rating')).toBeInTheDocument(); |
| 46 | + }); |
| 47 | + |
| 48 | + it('renders testimonial content', () => { |
| 49 | + render(<WallOfLove />); |
| 50 | + |
| 51 | + expect(screen.getAllByText(/Alex Chen/i).length).toBeGreaterThan(0); |
| 52 | + }); |
| 53 | + |
| 54 | + it('renders the developer community badge', () => { |
| 55 | + render(<WallOfLove />); |
| 56 | + |
| 57 | + expect(screen.getByText(/Loved by developers worldwide/i)).toBeInTheDocument(); |
| 58 | + }); |
| 59 | +}); |
0 commit comments