import "@testing-library/jest-dom/vitest";

// jsdom implements scrollTo as a noisy not-implemented stub.
Object.defineProperty(window, "scrollTo", {
  writable: true,
  value: () => {},
});

// jsdom has no matchMedia; the theme hook and reduced-motion checks need it.
if (!window.matchMedia) {
  Object.defineProperty(window, "matchMedia", {
    writable: true,
    value: (query: string) => ({
      matches: false,
      media: query,
      onchange: null,
      addListener: () => {},
      removeListener: () => {},
      addEventListener: () => {},
      removeEventListener: () => {},
      dispatchEvent: () => false,
    }),
  });
}
