Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard): Make FilterBar width resizable #20778

Merged
merged 9 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions superset-frontend/spec/helpers/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import 'jest-enzyme';
import './shim';
import { configure as configureTestingLibrary } from '@testing-library/react';
import { matchers } from '@emotion/jest';

configureTestingLibrary({
testIdAttribute: 'data-test',
});

document.body.innerHTML = '<div id="app" data-bootstrap="{}"></div>';
expect.extend(matchers);
24 changes: 17 additions & 7 deletions superset-frontend/spec/helpers/testing-library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import { render, RenderOptions } from '@testing-library/react';
import { ThemeProvider, supersetTheme } from '@superset-ui/core';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { combineReducers, createStore, applyMiddleware, compose } from 'redux';
import {
combineReducers,
createStore,
applyMiddleware,
compose,
Store,
} from 'redux';
import thunk from 'redux-thunk';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
Expand All @@ -36,6 +42,7 @@ type Options = Omit<RenderOptions, 'queries'> & {
useRouter?: boolean;
initialState?: {};
reducers?: {};
store?: Store;
};

function createWrapper(options?: Options) {
Expand All @@ -46,6 +53,7 @@ function createWrapper(options?: Options) {
useRouter,
initialState,
reducers,
store,
} = options || {};

return ({ children }: { children?: ReactNode }) => {
Expand All @@ -58,13 +66,15 @@ function createWrapper(options?: Options) {
}

if (useRedux) {
const store = createStore(
combineReducers(reducers || reducerIndex),
initialState || {},
compose(applyMiddleware(thunk)),
);
const mockStore =
store ??
createStore(
combineReducers(reducers || reducerIndex),
initialState || {},
compose(applyMiddleware(thunk)),
);

result = <Provider store={store}>{result}</Provider>;
result = <Provider store={mockStore}>{result}</Provider>;
}

if (useQueryParams) {
Expand Down

This file was deleted.

Loading