Files
Creeer-Web/components/layout/__tests__/Footer.test.tsx
T
erikghandClaude Opus 5 156f78c5a8 feat(recorrido): una fotografía por punto, bajo las capas azul y blanca
Cada punto de inflexión trae su imagen de fondo, relacionada con lo que
plantea: una carretera de montaña sin final visible para «el siguiente
salto no tiene mapa», un edificio a medio construir, la cosecha —el
esfuerzo convertido en resultado—, cables cruzando el cielo, un puerto de
contenedores, una ciudad entera a la vez.

Pasan por FondoFoto, que las funde en luminosidad sobre el degradado azul
→ dorado: ninguna aporta color propio. Encima, el velo claro sostiene la
pregunta en azul y el velo azul se lleva el fotograma entero para la
respuesta. La foto da grano, nunca manda.

Todas de Wikimedia Commons con licencia de reuso, acreditadas en
creditosFotos. Descarté la del enredo de cables sobre una calle: bajo el
velo seguía leyéndose el rótulo de un bar ajeno.

El test del footer fijaba dos créditos a mano; ahora cuenta contra la
propia lista, que es el único sitio donde se hace cumplir la atribución.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 12:56:30 -06:00

32 lines
1.5 KiB
TypeScript

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { Footer } from '../Footer';
import { creditosFotos } from '@/lib/content';
describe('<Footer />', () => {
it('renders the tagline and the legal line', () => {
render(<Footer />);
expect(screen.getByText('CLARIDAD · DIRECCIÓN · CRECIMIENTO')).toBeInTheDocument();
expect(screen.getByText(/© 2026 creeer/)).toBeInTheDocument();
});
it('does not introduce a second h1', () => {
render(<Footer />);
expect(screen.queryByRole('heading', { level: 1 })).toBeNull();
});
it('credits every reused photograph, with author, licence and modification notice', () => {
render(<Footer />);
// The licences these photographs carry require three things: naming the
// author, linking the licence, and saying the image was modified. This is
// the only place in the project where that obligation is enforced, so it
// counts against `creditosFotos` itself rather than a number typed here —
// adding a photograph without crediting it has to fail, and a hard-coded
// count only fails once someone remembers to update it.
for (const credito of creditosFotos) {
expect(credito.desc).toMatch(/—\s*\S/); // the author, after the em dash
expect(screen.getByText(credito.desc)).toHaveAttribute('href', credito.href);
expect(screen.getAllByText(credito.licencia).length).toBeGreaterThan(0);
}
expect(screen.getAllByText(/modificada/)).toHaveLength(creditosFotos.length);
});
});