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>
55 lines
2.0 KiB
TypeScript
55 lines
2.0 KiB
TypeScript
import { render } from '@testing-library/react';
|
|
import { describe, it, expect, vi, afterEach } from 'vitest';
|
|
|
|
// jsdom has no WebGL, so the real <Canvas> cannot mount. The mock keeps the
|
|
// wrapper — the part that is plain DOM and that carries the decisions worth
|
|
// protecting — testable, and reports back the frameloop it was handed.
|
|
vi.mock('@react-three/fiber', () => ({
|
|
Canvas: ({ frameloop }: { frameloop?: string }) => (
|
|
<div data-testid="lienzo" data-frameloop={frameloop} />
|
|
),
|
|
useFrame: () => {},
|
|
useThree: () => ({ camera: { position: { set: () => {} }, lookAt: () => {} }, invalidate: () => {} }),
|
|
}));
|
|
|
|
import { EscenaClaridad } from '../EscenaClaridad';
|
|
|
|
function conMovimientoReducido(reducido: boolean) {
|
|
window.matchMedia = ((query: string) => ({
|
|
matches: reducido && query.includes('reduce'),
|
|
media: query,
|
|
onchange: null,
|
|
addEventListener: () => {},
|
|
removeEventListener: () => {},
|
|
addListener: () => {},
|
|
removeListener: () => {},
|
|
dispatchEvent: () => false,
|
|
})) as unknown as typeof window.matchMedia;
|
|
}
|
|
|
|
afterEach(() => conMovimientoReducido(false));
|
|
|
|
describe('<EscenaClaridad />', () => {
|
|
it('is decorative: hidden from assistive tech', () => {
|
|
const { container } = render(<EscenaClaridad />);
|
|
expect(container.firstElementChild).toHaveAttribute('aria-hidden', 'true');
|
|
});
|
|
|
|
it('takes its size from the caller, so the hero reserves the box', () => {
|
|
const { container } = render(<EscenaClaridad className="w-full h-full" />);
|
|
expect(container.firstElementChild).toHaveClass('w-full', 'h-full');
|
|
});
|
|
|
|
it('runs the loop while the hero is on screen', () => {
|
|
conMovimientoReducido(false);
|
|
const { getByTestId } = render(<EscenaClaridad />);
|
|
expect(getByTestId('lienzo')).toHaveAttribute('data-frameloop', 'always');
|
|
});
|
|
|
|
it('stops the loop for readers who asked for reduced motion', () => {
|
|
conMovimientoReducido(true);
|
|
const { getByTestId } = render(<EscenaClaridad />);
|
|
expect(getByTestId('lienzo')).toHaveAttribute('data-frameloop', 'demand');
|
|
});
|
|
});
|