import { render, screen } from '@testing-library/react'; import { describe, it, expect } from 'vitest'; import { Dolores } from '../Dolores'; describe('', () => { it('renders the four pains verbatim, in the client\'s first person', () => { render(); expect(screen.getByText(/Trabajo más y gano casi lo mismo que hace dos años\./)).toBeInTheDocument(); expect(screen.getByText(/no sé en cuál enfocar mi tiempo y mi dinero\./)).toBeInTheDocument(); expect(screen.getByText(/no puede crecer si yo no estoy en cada decisión\./)).toBeInTheDocument(); expect(screen.getByText(/ya no me sirve para el siguiente nivel\./)).toBeInTheDocument(); expect(screen.getAllByRole('listitem')).toHaveLength(4); }); it('closes with the resolution, not with more effort', () => { const { container } = render(); expect(container.textContent).toContain('Esto no se resuelve con más esfuerzo.'); expect(container.textContent).toContain('Se resuelve con una estrategia clara.'); }); it('centres the knot so the conductor thread runs through it', () => { const { container } = render(); // The knot is the centred decorative svg of the section; the conductor // thread runs down the centre, so only a centred knot gets traversed by // it — stitching the pain to the resolution below. const centrados = Array.from(container.querySelectorAll('svg')).filter((s) => { const cls = s.getAttribute('class') ?? ''; return cls.includes('left-1/2') && cls.includes('-translate-x-1/2'); }); expect(centrados.length).toBeGreaterThanOrEqual(1); }); it('does NOT introduce scarcity', () => { const { container } = render(); expect(container.textContent).not.toMatch(/cupos|cohorte|generación fundadora/i); }); });