upgrade material-ui to latest beta

This is a surprisingly complex upgrade. Some relevant changes from
[their CHANGELOG](https://github.com/mui-org/material-ui/blob/v5.0.0-beta.3/CHANGELOG.md):

* @material-ui/core/styles no longer re-exports some stuff from
  @material-ui/styles
* there's no more defaultTheme, so tests need to provide one
* select's onChange has a new type; match that. I haven't actually
  tried that the string form (apparently from autofill) works correctly.
* checkboxes no longer default to the secondary color; explicitly
  request this in some places.
* checkbox no longer has a checked argument; use event.target.checked
  instead.
* date pickers have switched to the new style system, so I had to
  redo how I was overridding their spacing for desktop.
* LoadingButton now has a loading property, not pending
* createMuiTheme is no createTheme
This commit is contained in:
Scott Lamb
2021-08-10 11:57:16 -07:00
parent c55032dfcd
commit 39a63e03ae
15 changed files with 29918 additions and 3140 deletions

View File

@@ -2,6 +2,7 @@
// Copyright (C) 2021 The Moonfire NVR Authors; see AUTHORS and LICENSE.txt.
// SPDX-License-Identifier: GPL-v3.0-or-later WITH GPL-3.0-linking-exception
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
import { render } from "@testing-library/react";
import { SnackbarProvider } from "./snackbars";
@@ -10,7 +11,9 @@ export function renderWithCtx(
): Pick<ReturnType<typeof render>, "rerender"> {
function wrapped(children: React.ReactElement): React.ReactElement {
return (
<SnackbarProvider autoHideDuration={5000}>{children}</SnackbarProvider>
<ThemeProvider theme={createTheme()}>
<SnackbarProvider autoHideDuration={5000}>{children}</SnackbarProvider>
</ThemeProvider>
);
}
const { rerender } = render(wrapped(children));