mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
fix: Fixed saved query export (#14086)
* Fixed saved query export * Te sting implemented
This commit is contained in:
committed by
GitHub
parent
4b23d0ecca
commit
6392d41ac9
@@ -26,6 +26,7 @@ import { render, screen, cleanup } from 'spec/helpers/testing-library';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { QueryParamProvider } from 'use-query-params';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { handleBulkSavedQueryExport } from 'src/views/CRUD/utils';
|
||||
import * as featureFlags from 'src/featureFlags';
|
||||
import SavedQueryList from 'src/views/CRUD/data/savedquery/SavedQueryList';
|
||||
import SubMenu from 'src/components/Menu/SubMenu';
|
||||
@@ -95,6 +96,9 @@ fetchMock.get(queriesDistinctEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
|
||||
// Mock utils module
|
||||
jest.mock('src/views/CRUD/utils');
|
||||
|
||||
describe('SavedQueryList', () => {
|
||||
const wrapper = mount(
|
||||
<Provider store={store}>
|
||||
@@ -245,4 +249,12 @@ describe('RTL', () => {
|
||||
});
|
||||
expect(exportTooltip).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('runs handleBulkSavedQueryExport when export is clicked', () => {
|
||||
// Grab Export action button and mock mouse clicking it
|
||||
const exportActionButton = screen.getAllByRole('button')[17];
|
||||
userEvent.click(exportActionButton);
|
||||
|
||||
expect(handleBulkSavedQueryExport).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user