chore(screener): add @xyflow/react + vitest test environment

This commit is contained in:
2026-05-13 21:32:05 +09:00
parent d73ad9b851
commit 5f95f55271
4 changed files with 2627 additions and 3 deletions

34
src/test-setup.js Normal file
View File

@@ -0,0 +1,34 @@
import '@testing-library/jest-dom/vitest';
// jsdom polyfills for react-flow
if (typeof window !== 'undefined') {
if (!window.matchMedia) {
window.matchMedia = (query) => ({
matches: false,
media: query,
onchange: null,
addEventListener: () => {},
removeEventListener: () => {},
addListener: () => {},
removeListener: () => {},
dispatchEvent: () => false,
});
}
if (!window.ResizeObserver) {
window.ResizeObserver = class {
observe() {}
unobserve() {}
disconnect() {}
};
}
if (!window.DOMMatrixReadOnly) {
window.DOMMatrixReadOnly = class {
constructor() {}
m22 = 1;
};
}
}
beforeEach(() => {
localStorage.clear();
});