mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 02:10:45 -06:00
update mock to work with react-virtual
This commit is contained in:
parent
b5d218e06e
commit
a6e2962319
@ -88,8 +88,6 @@ throwUnhandledRejections();
|
||||
|
||||
// Used by useMeasure
|
||||
global.ResizeObserver = class ResizeObserver {
|
||||
//callback: ResizeObserverCallback;
|
||||
|
||||
constructor(callback: ResizeObserverCallback) {
|
||||
setTimeout(() => {
|
||||
callback(
|
||||
@ -105,8 +103,11 @@ global.ResizeObserver = class ResizeObserver {
|
||||
left: 100,
|
||||
right: 0,
|
||||
},
|
||||
target: {},
|
||||
} as ResizeObserverEntry,
|
||||
target: {
|
||||
// Needed for react-virtual to work in tests
|
||||
getAttribute: () => 1,
|
||||
},
|
||||
} as unknown as ResizeObserverEntry,
|
||||
],
|
||||
this
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user