Files
Creeer-Web/vitest.setup.ts
erikghandClaude Opus 5 a9758a92f9 feat(identidad): logos SVG oficiales, wordmark trazado y tokens del manual
El wordmark deja de depender del glifo tipográfico ≡ y pasa a un trazado
SVG propio (SimboloTresLineas), que es lo que permite cumplir la
instrucción de la dueña: que se lea como E, no como tres líneas sueltas.

Incluye las tres versiones del logotipo (principal, negativa, secundaria)
y alinea los tokens de color con el Manual de Identidad Visual v1.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 10:44:20 -06:00

49 lines
1.6 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import '@testing-library/jest-dom/vitest';
// jsdom lacks IntersectionObserver; Framer Motion's `whileInView` needs it.
if (typeof window !== 'undefined' && !('IntersectionObserver' in window)) {
class IntersectionObserverStub {
observe() {}
unobserve() {}
disconnect() {}
takeRecords() {
return [];
}
root = null;
rootMargin = '';
thresholds = [];
}
// @ts-expect-error – installing stub on window
window.IntersectionObserver = IntersectionObserverStub;
global.IntersectionObserver = IntersectionObserverStub;
}
// jsdom lacks ResizeObserver; Embla Carousel (Carrusel primitive) needs it.
if (typeof window !== 'undefined' && !('ResizeObserver' in window)) {
class ResizeObserverStub {
observe() {}
unobserve() {}
disconnect() {}
}
// @ts-expect-error – installing stub on window
window.ResizeObserver = ResizeObserverStub;
global.ResizeObserver = ResizeObserverStub;
}
// jsdom lacks matchMedia; usePrefersReducedMotion() calls it in useEffect.
// Note: vitest's jsdom environment pre-defines `matchMedia` as an own property
// set to `undefined`, so `'matchMedia' in window` is true even though it isn't
// a function — guard on typeof instead of `in`.
if (typeof window !== 'undefined' && typeof window.matchMedia !== 'function') {
window.matchMedia = (query: string) => ({
matches: false,
media: query,
onchange: null,
addEventListener: () => {},
removeEventListener: () => {},
addListener: () => {},
removeListener: () => {},
dispatchEvent: () => false,
}) as unknown as MediaQueryList;
}