michael-s-molina commented on a change in pull request #17069:
URL: https://github.com/apache/superset/pull/17069#discussion_r734439816



##########
File path: superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx
##########
@@ -47,35 +41,37 @@ describe('DatasourceEditor', () => {
   const store = mockStore({});
   fetchMock.get(DATASOURCE_ENDPOINT, []);
 
-  let wrapper;
   let el;
-  let inst;
   let isFeatureEnabledMock;
 
   beforeEach(() => {
-    el = <DatasourceEditor {...props} store={store} />;
-    wrapper = shallow(el).dive();
-    inst = wrapper.instance();
-  });
-
-  afterEach(() => {
-    wrapper.unmount();
+    el = (
+      <ThemeProvider theme={supersetTheme}>
+        <Provider store={store}>
+          <DatasourceEditor {...props} store={store} />;
+        </Provider>
+      </ThemeProvider>
+    );
+    render(el);

Review comment:
       The `render` of `spec/helpers/testing-library` already adds the 
`ThemeProvider`. You can also set other optional configurations as `useRedux`, 
`useDnd`, `useRouter`, etc. If you set `useRedux` the default mock will be 
used. You can also override the initial state with the `initialState` option.




-- 
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]

Reply via email to