mirror of
https://github.com/apache/superset.git
synced 2026-07-09 00:05:36 +00:00
feat(theming): land Ant Design v5 overhaul — dynamic themes, real dark mode + massive styling refactor (#31590)
Co-authored-by: Enzo Martellucci <52219496+EnxDev@users.noreply.github.com> Co-authored-by: Diego Pucci <diegopucci.me@gmail.com> Co-authored-by: Mehmet Salih Yavuz <salih.yavuz@proton.me> Co-authored-by: Geido <60598000+geido@users.noreply.github.com> Co-authored-by: Alexandru Soare <37236580+alexandrusoare@users.noreply.github.com> Co-authored-by: Damian Pendrak <dpendrak@gmail.com> Co-authored-by: Pius Iniobong <67148161+payose@users.noreply.github.com> Co-authored-by: Enzo Martellucci <enzomartellucci@gmail.com> Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2cc1ef88c8
commit
dd129fa403
@@ -16,16 +16,10 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { FC } from 'react';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
import fetchMock from 'fetch-mock';
|
||||
import { Provider } from 'react-redux';
|
||||
import {
|
||||
supersetTheme,
|
||||
ThemeProvider,
|
||||
isFeatureEnabled,
|
||||
} from '@superset-ui/core';
|
||||
import { isFeatureEnabled } from '@superset-ui/core';
|
||||
import {
|
||||
render,
|
||||
screen,
|
||||
@@ -71,12 +65,6 @@ jest.mock('@superset-ui/core', () => ({
|
||||
|
||||
const mockedIsFeatureEnabled = isFeatureEnabled as jest.Mock;
|
||||
|
||||
const standardProvider: FC = ({ children }) => (
|
||||
<ThemeProvider theme={supersetTheme}>
|
||||
<Provider store={store}>{children}</Provider>
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
const unsavedQueryEditor = {
|
||||
id: defaultProps.queryEditorId,
|
||||
dbId: 9888,
|
||||
@@ -87,22 +75,6 @@ const unsavedQueryEditor = {
|
||||
templateParams: '{ "my_value": "foo" }',
|
||||
};
|
||||
|
||||
const standardProviderWithUnsaved: FC = ({ children }) => (
|
||||
<ThemeProvider theme={supersetTheme}>
|
||||
<Provider
|
||||
store={mockStore({
|
||||
...initialState,
|
||||
sqlLab: {
|
||||
...initialState.sqlLab,
|
||||
unsavedQueryEditor,
|
||||
},
|
||||
})}
|
||||
>
|
||||
{children}
|
||||
</Provider>
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
describe('ShareSqlLabQuery', () => {
|
||||
const storeQueryUrl = 'glob:*/api/v1/sqllab/permalink';
|
||||
const storeQueryMockId = 'ci39c3';
|
||||
@@ -133,7 +105,8 @@ describe('ShareSqlLabQuery', () => {
|
||||
it('calls storeQuery() with the query when getCopyUrl() is called', async () => {
|
||||
await act(async () => {
|
||||
render(<ShareSqlLabQuery {...defaultProps} />, {
|
||||
wrapper: standardProvider,
|
||||
useRedux: true,
|
||||
store,
|
||||
});
|
||||
});
|
||||
const button = screen.getByRole('button');
|
||||
@@ -150,7 +123,14 @@ describe('ShareSqlLabQuery', () => {
|
||||
it('calls storeQuery() with unsaved changes', async () => {
|
||||
await act(async () => {
|
||||
render(<ShareSqlLabQuery {...defaultProps} />, {
|
||||
wrapper: standardProviderWithUnsaved,
|
||||
useRedux: true,
|
||||
store: mockStore({
|
||||
...initialState,
|
||||
sqlLab: {
|
||||
...initialState.sqlLab,
|
||||
unsavedQueryEditor,
|
||||
},
|
||||
}),
|
||||
});
|
||||
});
|
||||
const button = screen.getByRole('button');
|
||||
|
||||
Reference in New Issue
Block a user