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 2022/07/13 11:27:22 UTC

[GitHub] [superset] kgabryje commented on a diff in pull request #20675: refactor: Renders addSlice in SPA

kgabryje commented on code in PR #20675:
URL: https://github.com/apache/superset/pull/20675#discussion_r919966115


##########
superset-frontend/src/addSlice/AddSliceContainer.test.tsx:
##########
@@ -62,13 +61,20 @@ const mockUserWithDatasetWrite: UserWithPermissionsAndRoles = {
   isAnonymous: false,
 };
 
+// We don't need the actual implementation for the tests
+const routeProps = {
+  history: {} as any,
+  location: {} as any,
+  match: {} as any,
+};
+
 async function getWrapper(user = mockUser) {
   const wrapper = mount(
-    <AddSliceContainer user={user} addSuccessToast={() => null} />,
-    {
-      wrappingComponent: ThemeProvider,
-      wrappingComponentProps: { theme: supersetTheme },
-    },
+    <AddSliceContainer
+      user={user}
+      addSuccessToast={() => null}
+      {...routeProps}

Review Comment:
   Nit: I think you can use MemoryRouter instead of manually adding routeProps
   ```
   <MemoryRouter>
     <AddSliceContainer ... />
   </MemoryRouter>
   ```



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