From 734e109938d3a17b0dc9487b4a258b4633956f43 Mon Sep 17 00:00:00 2001 From: DiegoAndai Date: Fri, 3 Jan 2025 15:23:32 -0300 Subject: [PATCH 1/3] Test removing suspense from TestViewer --- test/regressions/TestViewer.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/test/regressions/TestViewer.js b/test/regressions/TestViewer.js index f261809e3c69b0..e6568b5b6ca4c4 100644 --- a/test/regressions/TestViewer.js +++ b/test/regressions/TestViewer.js @@ -76,29 +76,27 @@ function TestViewer(props) { }, }} /> - }> - {window.location.pathname.startsWith('/docs-joy') ? ( - - - {children} - - - ) : ( - + {children} - - )} - + + + ) : ( + + {children} + + )} ); } From c1e0729e804976cc8b48b0dd91ac6300d693acf2 Mon Sep 17 00:00:00 2001 From: DiegoAndai Date: Wed, 8 Jan 2025 11:11:21 -0300 Subject: [PATCH 2/3] Remove clock mock --- test/regressions/TestViewer.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/regressions/TestViewer.js b/test/regressions/TestViewer.js index e6568b5b6ca4c4..5d945bac91f2c8 100644 --- a/test/regressions/TestViewer.js +++ b/test/regressions/TestViewer.js @@ -1,6 +1,5 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import { useFakeTimers } from 'sinon'; import Box from '@mui/material/Box'; import GlobalStyles from '@mui/material/GlobalStyles'; import JoyBox from '@mui/joy/Box'; @@ -29,13 +28,6 @@ function TestViewer(props) { document.fonts.addEventListener('loading', handleFontsEvent); document.fonts.addEventListener('loadingdone', handleFontsEvent); - // Use a "real timestamp" so that we see a useful date instead of "00:00" - // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- useFakeTimers is not a React hook - // eslint-disable-next-line react-hooks/rules-of-hooks -- not a React hook - const clock = useFakeTimers({ - now: new Date('Mon Aug 18 14:11:54 2014 -0500'), - toFake: ['Date'], - }); // In case the child triggered font fetching we're not ready yet. // The fonts event handler will mark the test as ready on `loadingdone` if (document.fonts.status === 'loaded') { @@ -45,7 +37,6 @@ function TestViewer(props) { return () => { document.fonts.removeEventListener('loading', handleFontsEvent); document.fonts.removeEventListener('loadingdone', handleFontsEvent); - clock.restore(); }; }, []); From 14bc608f7fca7910bacaa67ddb5a921a6832e6eb Mon Sep 17 00:00:00 2001 From: DiegoAndai Date: Wed, 8 Jan 2025 11:16:24 -0300 Subject: [PATCH 3/3] Remove suspense from e2e test --- test/e2e/TestViewer.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/e2e/TestViewer.js b/test/e2e/TestViewer.js index 09c21fd4d7f755..7b9db57d1b49fe 100644 --- a/test/e2e/TestViewer.js +++ b/test/e2e/TestViewer.js @@ -13,11 +13,9 @@ function TestViewer(props) { }, []); return ( - }> -
- {children} -
-
+
+ {children} +
); }