Skip to content

Commit

Permalink
Start enabling legacy roots where incompatible with React 18
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 9, 2021
1 parent 6708208 commit 4daf16f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ describe('<DesktopDatePicker />', () => {
TransitionComponent={FakeTransitionComponent}
renderInput={(params) => <TextField {...params} />}
/>,
// TODO: React18Compat
{ legacyRoot: true },
);

act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ describe('<DesktopDateTimePicker />', () => {
onChange={() => {}}
renderInput={(params) => <TextField autoFocus {...params} />}
/>,
// TODO: React18Compat
{ legacyRoot: true },
);

userEvent.mousePress(screen.getByLabelText(/choose date/i));
Expand Down
3 changes: 2 additions & 1 deletion packages/material-ui/src/Autocomplete/Autocomplete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function checkHighlightIs(listbox, expected) {
}

describe('<Autocomplete />', () => {
const render = createClientRender();
// TODO: React18Compat
const render = createClientRender({ legacyRoot: true });
const mount = createMount();

describeConformanceV5(
Expand Down
5 changes: 5 additions & 0 deletions test/utils/mochaHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ function createUnexpectedConsoleMessagesHooks(Mocha, methodName, expectedMatcher
}
}

// FIXME: ignore act warnings
if (message.indexOf('act(...)')) {
return;
}

unexpectedCalls.push([
// first line includes the (empty) error message
// i.e. Remove the `Error:` line
Expand Down

0 comments on commit 4daf16f

Please sign in to comment.