forge
Explore
Log in

Don't you dare go Hollow

🧪 stub scrollIntoView in the test setup

Browse files at this commit

5fcd955cc933a21f1e420d2722579318a3a8f64eBurak BoduroğluParent: 0c8ecec
  • fix
    • 🧪 stub scrollIntoView in the test setup
Show full message
fix: 🧪 stub scrollIntoView in the test setup

- jsdom has no scrollIntoView; the insights runs table scrolls its report
  into view on row select, and 17 uncaught TypeErrors failed the CI test
  step although every test passed
src/test-setup.tsmodified+1 -0
@@ -5,6 +5,7 @@ if (typeof window !== "undefined") {
5 // jsdom intentionally does not implement scrolling and logs a warning when5 // jsdom intentionally does not implement scrolling and logs a warning when
6 // UI code calls it. Scrolling is outside the scope of these component tests.6 // UI code calls it. Scrolling is outside the scope of these component tests.
7 window.scrollTo = () => undefined;7 window.scrollTo = () => undefined;
8+ Element.prototype.scrollIntoView = () => undefined;
8 const values = new Map<string, string>();9 const values = new Map<string, string>();
9 const storage = {10 const storage = {
10 get length() { return values.size; },11 get length() { return values.size; },