diff --git a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts index fb77ab90f8a42..fc9ed46b2168f 100644 --- a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts +++ b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts @@ -105,7 +105,9 @@ describe('comms', () => { let originalConsoleError: any = null; beforeAll(() => { - global.MessageChannel = FakeMessageChannel; // yolo + Object.defineProperty(global, 'MessageChannel', { + value: FakeMessageChannel, + }); originalConsoleDebug = console.debug; originalConsoleError = console.error; }); diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 85e42d9032359..c99d1d866c7eb 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -283,7 +283,7 @@ const DashboardBuilder: FC = () => { setBarTopOffset(headerRef.current?.getBoundingClientRect()?.height || 0); let observer: ResizeObserver; - if (typeof global.ResizeObserver !== 'undefined' && headerRef.current) { + if (global.hasOwnProperty('ResizeObserver') && headerRef.current) { observer = new ResizeObserver(entries => { setBarTopOffset( current => entries?.[0]?.contentRect?.height || current,