Skip to content

Commit

Permalink
[DataGrid] Change test dom check from /jsdom/ to /jsdom|HappyDOM/. (m…
Browse files Browse the repository at this point in the history
…ui#15634)

Co-authored-by: Joachim Desroches <jo@thedesroches.net>
  • Loading branch information
2 people authored and LukasTy committed Dec 19, 2024
1 parent d42195d commit 39f7ec6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type ScrollCache = ReturnType<typeof createScrollCache>;
let isJSDOM = false;
try {
if (typeof window !== 'undefined') {
isJSDOM = /jsdom/.test(window.navigator.userAgent);
isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
}
} catch (_) {
/* ignore */
Expand Down

0 comments on commit 39f7ec6

Please sign in to comment.