Files
pterodactyl-panel/resources/scripts/setup-tests.ts
T

16 lines
646 B
TypeScript
Raw Normal View History

2026-10-05 18:10:18 -04:00
import '@testing-library/jest-dom/vitest';
2026-10-12 09:04:03 -04:00
import { classicSkins } from '@/themes/classic/skins';
import { registerSkins } from '@/themes/skins';
2026-10-05 18:10:18 -04:00
// jsdom lacks PointerEvent, which Base UI dispatches.
if (globalThis.window?.PointerEvent === undefined && globalThis.window?.MouseEvent) {
Object.defineProperty(globalThis.window, 'PointerEvent', { value: globalThis.window.MouseEvent });
}
if (globalThis.window?.navigator.userAgent.includes('jsdom')) {
globalThis.window.scrollTo = () => {};
}
2026-10-12 09:04:03 -04:00
// The panel registers classic before its first render; components under test render without booting.
registerSkins('classic', classicSkins);