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