From 4969f7e203e60921cdcf6073e59d864d59b41664 Mon Sep 17 00:00:00 2001 From: Joachim Desroches <129734564+jedesroches@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:16:10 +0100 Subject: [PATCH 1/2] [DataGrid] Change test dom check from /jsdom/ to /jsdom|HappyDOM/. (#15634) Co-authored-by: Joachim Desroches --- .../src/hooks/features/dimensions/useGridDimensions.ts | 2 +- .../hooks/features/virtualization/useGridVirtualScroller.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts b/packages/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts index d7c7971b99e86..35400be877255 100644 --- a/packages/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts +++ b/packages/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts @@ -350,7 +350,7 @@ export function useGridDimensions( rootDimensionsRef.current = size; // jsdom has no layout capabilities - const isJSDOM = /jsdom/.test(window.navigator.userAgent); + const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent); if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) { logger.error( diff --git a/packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx b/packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx index 679b05f8bbbbb..499c21a66c40b 100644 --- a/packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx +++ b/packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx @@ -92,7 +92,7 @@ type ScrollCache = ReturnType; let isJSDOM = false; try { if (typeof window !== 'undefined') { - isJSDOM = /jsdom/.test(window.navigator.userAgent); + isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent); } } catch (_) { /* ignore */ From efef7368c53cb4d79b856717caa38a205f219ff5 Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Thu, 28 Nov 2024 02:27:43 -0500 Subject: [PATCH 2/2] ci: run (empty commit)