kgabryje commented on code in PR #32207:
URL: https://github.com/apache/superset/pull/32207#discussion_r1951093871
##########
superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx:
##########
@@ -35,25 +30,11 @@ import {
SlowChartPlugin,
} from './MockChartPlugins';
-const Wrapper = ({
- theme,
- children,
-}: {
- theme: SupersetTheme;
- children: ReactNode;
-}) => <ThemeProvider theme={theme}>{children}</ThemeProvider>;
-
-const styledMount = (component: ReactElement) =>
- mount(component, {
- wrappingComponent: Wrapper,
- wrappingComponentProps: {
- theme: supersetTheme,
- },
- });
+const renderWithTheme = (component: ReactElement) =>
+ render(<ThemeProvider theme={supersetTheme}>{component}</ThemeProvider>);
Review Comment:
When importing `render` from `spec/helpers/testing-library`, the rendered
component is already wrapped in theme provider 🙂
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]