MCPcopy
hub / github.com/glideapps/glide-data-grid / prep

Function prep

packages/core/test/data-editor.test.tsx:218–239  ·  view source on GitHub ↗
(resetTimers: boolean = true)

Source from the content-addressed store, hash-verified

216}
217
218function prep(resetTimers: boolean = true) {
219 const scroller = document.getElementsByClassName("dvn-scroller").item(0);
220 if (scroller !== null) {
221 vi.spyOn(scroller, "clientWidth", "get").mockImplementation(() => 1000);
222 vi.spyOn(scroller, "clientHeight", "get").mockImplementation(() => 1000);
223 vi.spyOn(scroller, "offsetWidth" as any, "get").mockImplementation(() => 1000);
224 vi.spyOn(scroller, "offsetHeight" as any, "get").mockImplementation(() => 1000);
225 }
226
227 act(() => {
228 vi.runAllTimers();
229 });
230 if (resetTimers) {
231 vi.useRealTimers();
232 } else {
233 act(() => {
234 vi.runAllTimers();
235 });
236 }
237
238 return scroller;
239}
240
241const Context: React.FC = p => {
242 return (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…