mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-02 06:07:51 -05:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user