You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/22 10:57:50 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #17069: chore: remove supersetTheme with withTheme

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org