Files
Creeer-Web/components/sections/__tests__/ComoEmpezar.test.tsx
T
erikghandClaude Opus 5.5 89e54a6e84 feat: rediseño «El documento» en curso, contacto real y enlaces externos
Primitivas y contenido del rediseño (escala tipográfica, Revelar,
MarcaSeccion, Seccion, Antetitulo, SimboloMarca, Resplandor, ClaridadHero,
sección Proceso de ocho etapas, lib/content.ts reestructurado en seis
secciones con alias para las viejas). Mecanismo y FormaTrabajar se retiran.

Encima, lo de esta sesión:
- recorrido: creeer vuelve a responder cada situación en vez de repetirla
  (el alias apuntaba respuesta a situacion); respuestas en plural. Créditos
  de las seis fotos de México.
- contacto: WhatsApp, email (con mailto:) y LinkedIn reales; iconos de las
  redes en el cierre y el footer (IconoRed, trazos de Simple Icons, CC0).
- enlaces: lo externo abre en otra pestaña con noopener y aviso para
  lectores de pantalla (lib/enlaces.ts); mailto y anclas se quedan.
- Proceso: las ocho tarjetas no aparecían nunca en móvil (amount 0.3 sobre
  una lista de ~3000px); ahora cada una se revela sola. El ≡ de la 08 ya no
  tapa un entregable, título equilibrado, etiqueta a 12px, sin elevar al
  hover lo que no es clicable.
- Disciplinas: la frase «No son la promesa — son los medios» gana peso y
  se agrupa con título e ilustración; sin cortes huérfanos en móvil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 11:27:20 -06:00

41 lines
1.8 KiB
TypeScript

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { ComoEmpezar } from '../ComoEmpezar';
describe('<ComoEmpezar />', () => {
it('renders the on-ramp steps', () => {
render(<ComoEmpezar />);
expect(screen.getByText('Escríbenos')).toBeInTheDocument();
expect(screen.getByText('Sesión de claridad')).toBeInTheDocument();
});
it('links the CTA to WhatsApp with a prefilled message', () => {
render(<ComoEmpezar />);
const cta = screen.getByRole('link', { name: /Agenda tu sesión de claridad/i });
const href = cta.getAttribute('href') ?? '';
expect(href).toMatch(/^https:\/\/wa\.me\//);
expect(href).toContain('text=');
});
it('renders the sunrise photo panel as decorative, not real content', () => {
const { container } = render(<ComoEmpezar />);
const img = container.querySelector('img');
// next/image rewrites `src` through its loader in this test environment;
// the static export (images.unoptimized: true) serves the plain path.
expect(img?.getAttribute('src')).toContain('comoempezar-bg.jpg');
expect(img).toHaveAttribute('alt', '');
});
it('keeps all three steps readable without interaction', () => {
const { container } = render(<ComoEmpezar />);
// The steps used to sit at opacity-40 until the reader hovered or the
// autoplay reached them, which made two of every three illegible.
expect(container.innerHTML).not.toContain('opacity-40');
});
it('presents the steps as content, not as controls', () => {
render(<ComoEmpezar />);
// Without autoplay there is nothing to steer, so the steps stop being
// buttons and go back to being a plain ordered list.
expect(screen.queryAllByRole('button')).toHaveLength(0);
});
});