From f5a699d2154dfe34405b8487435fe8ec83c3037b Mon Sep 17 00:00:00 2001 From: Mehmet Salih Yavuz Date: Thu, 9 Jan 2025 23:08:18 +0300 Subject: [PATCH] test(ListView): provide store --- .../src/components/ListView/ListView.test.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/components/ListView/ListView.test.jsx b/superset-frontend/src/components/ListView/ListView.test.jsx index 64869ad67acd8..5658f4069e8ae 100644 --- a/superset-frontend/src/components/ListView/ListView.test.jsx +++ b/superset-frontend/src/components/ListView/ListView.test.jsx @@ -20,6 +20,8 @@ import { styledMount as mount } from 'spec/helpers/theming'; import { act } from 'react-dom/test-utils'; import { QueryParamProvider } from 'use-query-params'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; +import thunk from 'redux-thunk'; +import configureStore from 'redux-mock-store'; import Button from 'src/components/Button'; import { Empty } from 'src/components/EmptyState/Empty'; @@ -33,6 +35,10 @@ import TableCollection from 'src/components/TableCollection'; import Pagination from 'src/components/Pagination/Wrapper'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; +import { Provider } from 'react-redux'; + +const middlewares = [thunk]; +const mockStore = configureStore(middlewares); function makeMockLocation(query) { const queryStr = encodeURIComponent(query); @@ -125,12 +131,15 @@ const mockedProps = { const factory = (props = mockedProps) => mount( - - - , + + + + + , { wrappingComponent: ThemeProvider, wrappingComponentProps: { theme: supersetTheme }, + useRedux: true, }, );