Skip to content

Commit

Permalink
fix(CodeEditor): account for special characters inside tables and col…
Browse files Browse the repository at this point in the history
…umns names (#4493)

* fix(CodeEditor): account for special characters inside tables and columns names

* chore: dedupe package lock

* chore: run test in node env

* chore: remove unused ts-expect-error
  • Loading branch information
MEsteves22 authored Jan 3, 2025
1 parent a6dd752 commit 6c79b50
Show file tree
Hide file tree
Showing 24 changed files with 676 additions and 178 deletions.
45 changes: 24 additions & 21 deletions .config/test.setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,28 @@ beforeAll(() => {
unobserve() {}
}

window.ResizeObserver = ResizeObserver;

Object.defineProperty(window, "IntersectionObserver", {
writable: true,
configurable: true,
value: IntersectionObserver,
});

Object.defineProperty(window, "matchMedia", {
writable: true,
value: vi.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: vi.fn(), // Deprecated
removeListener: vi.fn(), // Deprecated
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
});
// Tests running in Node environment don't have access to the window global object
if (typeof window !== "undefined") {
window.ResizeObserver = ResizeObserver;

Object.defineProperty(window, "IntersectionObserver", {
writable: true,
configurable: true,
value: IntersectionObserver,
});

Object.defineProperty(window, "matchMedia", {
writable: true,
value: vi.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: vi.fn(), // Deprecated
removeListener: vi.fn(), // Deprecated
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
});
}
});
Loading

0 comments on commit 6c79b50

Please sign in to comment.