Files
Creeer-Web/components/sections/__tests__/Dolores.test.tsx
T
erikghandClaude Opus 5 367e769f5e feat(dolores): el nudo al centro para que el hilo lo atraviese
El nudo vivía arriba a la derecha, donde el hilo conductor no lo tocaba.
Centrado, el hilo lo atraviesa: el dolor cosido por lo mismo que lo va a
desatar, y el remate "se resuelve con una estrategia clara" queda justo
debajo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 15:33:17 -06:00

35 lines
1.8 KiB
TypeScript

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { Dolores } from '../Dolores';
describe('<Dolores />', () => {
it('renders the four pains verbatim, in the client\'s first person', () => {
render(<Dolores />);
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(<Dolores />);
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(<Dolores />);
// 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(<Dolores />);
expect(container.textContent).not.toMatch(/cupos|cohorte|generación fundadora/i);
});
});