From fa510df624244a9b1b07875ed21ee0b7b47ac6eb Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Thu, 6 May 2021 01:58:40 -0300 Subject: [PATCH] chore: Adds QueryParamProvider to testing helper (#14195) --- superset-frontend/spec/helpers/testing-library.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/spec/helpers/testing-library.tsx b/superset-frontend/spec/helpers/testing-library.tsx index c9e6c46cba..7366b8d4c6 100644 --- a/superset-frontend/spec/helpers/testing-library.tsx +++ b/superset-frontend/spec/helpers/testing-library.tsx @@ -26,16 +26,19 @@ import thunk from 'redux-thunk'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import reducerIndex from 'spec/helpers/reducerIndex'; +import { QueryParamProvider } from 'use-query-params'; type Options = Omit & { useRedux?: boolean; useDnd?: boolean; + useQueryParams?: boolean; initialState?: {}; reducers?: {}; }; function createWrapper(options?: Options) { - const { useDnd, useRedux, initialState, reducers } = options || {}; + const { useDnd, useRedux, useQueryParams, initialState, reducers } = + options || {}; return ({ children }: { children?: ReactNode }) => { let result = ( @@ -56,6 +59,10 @@ function createWrapper(options?: Options) { result = {result}; } + if (useQueryParams) { + result = {result}; + } + return result; }; }