Skip to content

Commit

Permalink
Te
Browse files Browse the repository at this point in the history
sting implemented
  • Loading branch information
lyndsiWilliams committed Apr 12, 2021
1 parent c83180f commit 9a2d39a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}>
Expand Down Expand Up @@ -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();
});
});

0 comments on commit 9a2d39a

Please sign in to comment.