- configStyles.ts: add listDetailRoot, listPane, listItem, listItemSelected, detailPane style slots - index.ts: export ConfigListDetail and RawConfigSection - api/config.ts: add writeFilterFile and writeActionFile API helpers - setupTests.ts: add ResizeObserver and matchMedia mocks for Fluent UI v9 - ConfigPageLogPath.test.tsx: update to render inside FluentProvider - Docs/Tasks.md: mark config view redesign task as complete
37 lines
1015 B
TypeScript
37 lines
1015 B
TypeScript
import { expect, afterEach } from "vitest";
|
|
import { cleanup } from "@testing-library/react";
|
|
import * as jestDomMatchers from "@testing-library/jest-dom/matchers";
|
|
|
|
// Extend Vitest's expect with jest-dom matchers (toBeInTheDocument, etc.)
|
|
expect.extend(jestDomMatchers);
|
|
|
|
// Ensure React Testing Library cleans up after every test
|
|
afterEach(cleanup);
|
|
|
|
// Recharts and Fluent UI rely on ResizeObserver which jsdom does not provide.
|
|
class ResizeObserverStub {
|
|
observe() {}
|
|
unobserve() {}
|
|
disconnect() {}
|
|
}
|
|
|
|
globalThis.ResizeObserver = ResizeObserverStub;
|
|
|
|
// jsdom does not implement scrollIntoView.
|
|
Element.prototype.scrollIntoView = () => {};
|
|
|
|
// Fluent UI animations rely on matchMedia.
|
|
Object.defineProperty(window, "matchMedia", {
|
|
writable: true,
|
|
value: (query: string) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: () => {},
|
|
removeListener: () => {},
|
|
addEventListener: () => {},
|
|
removeEventListener: () => {},
|
|
dispatchEvent: () => false,
|
|
}),
|
|
});
|