Skip to content

Commit

Permalink
change name
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Mar 3, 2025
1 parent beb51b2 commit e140913
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { coreMock } from '@kbn/core/public/mocks';
import { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks';
import { generateId } from '../../../id_generator';
import { mountWithProvider } from '../../../mocks';
import { mountWithReduxStore } from '../../../mocks';
import { LayerTypes } from '@kbn/expression-xy-plugin/public';
import { ReactWrapper } from 'enzyme';
import { createIndexPatternServiceMock } from '../../../mocks/data_views_service_mock';
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('ConfigPanel', () => {
query?: Query | AggregateQuery
) {
(generateId as jest.Mock).mockReturnValue(`newId`);
return mountWithProvider(
return mountWithReduxStore(
<LayerPanels {...props} />,
{
preloadedState: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
createMockVisualization,
createMockFramePublicAPI,
createMockDatasource,
mountWithProvider,
mountWithReduxStore,
createMockedDragDropContext,
renderWithReduxStore,
} from '../../../mocks';
Expand Down Expand Up @@ -701,7 +701,7 @@ describe('LayerPanel', () => {
target.columnId !== 'a' ? { dropTypes: ['field_replace'], nextLabel: '' } : undefined
);

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingField })}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>
Expand Down Expand Up @@ -760,7 +760,7 @@ describe('LayerPanel', () => {
nextLabel: '',
});

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>
Expand Down Expand Up @@ -820,7 +820,7 @@ describe('LayerPanel', () => {
const holder = document.createElement('div');
document.body.appendChild(holder);

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>,
Expand Down Expand Up @@ -858,7 +858,7 @@ describe('LayerPanel', () => {
],
});

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>
Expand Down Expand Up @@ -895,7 +895,7 @@ describe('LayerPanel', () => {
],
});

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel {...getDefaultProps()} activeVisualization={mockVis} />
</ChildDragDropProvider>
Expand Down Expand Up @@ -936,7 +936,7 @@ describe('LayerPanel', () => {
mockDatasource.onDrop.mockReturnValue(true);
const updateVisualization = jest.fn();

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel
{...getDefaultProps()}
Expand Down Expand Up @@ -987,7 +987,7 @@ describe('LayerPanel', () => {
mockDatasource.onDrop.mockReturnValue(false);
const updateVisualization = jest.fn();

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel
{...getDefaultProps()}
Expand Down Expand Up @@ -1027,7 +1027,7 @@ describe('LayerPanel', () => {

mockDatasource.onDrop.mockReturnValue(true);

const { instance } = await mountWithProvider(
const { instance } = await mountWithReduxStore(
<ChildDragDropProvider value={createMockedDragDropContext({ dragging: draggingOperation })}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SuggestionPanel, SuggestionPanelProps, SuggestionPanelWrapper } from '.
import { getSuggestions } from './suggestion_helpers';
import { EuiIcon, EuiPanel, EuiToolTip, EuiAccordion } from '@elastic/eui';
import { IconChartDatatable } from '@kbn/chart-icons';
import { mountWithProvider } from '../../mocks';
import { mountWithReduxStore } from '../../mocks';
import { coreMock } from '@kbn/core/public/mocks';

import {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('suggestion_panel', () => {
});

it('should avoid completely to render SuggestionPanel when in fullscreen mode', async () => {
const { instance, lensStore } = await mountWithProvider(
const { instance, lensStore } = await mountWithReduxStore(
<SuggestionPanelWrapper {...defaultProps} />
);
expect(instance.find(SuggestionPanel).exists()).toBe(true);
Expand All @@ -131,7 +131,7 @@ describe('suggestion_panel', () => {
});

it('should display apply-changes prompt when changes not applied', async () => {
const { instance, lensStore } = await mountWithProvider(<SuggestionPanel {...defaultProps} />, {
const { instance, lensStore } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />, {
preloadedState: {
...preloadedState,
visualization: {
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('suggestion_panel', () => {
});

it('should list passed in suggestions', async () => {
const { instance } = await mountWithProvider(<SuggestionPanel {...defaultProps} />, {
const { instance } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />, {
preloadedState,
});

Expand Down Expand Up @@ -199,7 +199,7 @@ describe('suggestion_panel', () => {
});

it('should not update suggestions if current state is moved to staged preview', async () => {
const { instance, lensStore } = await mountWithProvider(
const { instance, lensStore } = await mountWithReduxStore(
<SuggestionPanel {...defaultProps} />,
{ preloadedState }
);
Expand All @@ -210,7 +210,7 @@ describe('suggestion_panel', () => {
});

it('should update suggestions if staged preview is removed', async () => {
const { instance, lensStore } = await mountWithProvider(
const { instance, lensStore } = await mountWithReduxStore(
<SuggestionPanel {...defaultProps} />,
{ preloadedState }
);
Expand All @@ -234,7 +234,7 @@ describe('suggestion_panel', () => {
});

it('should rollback suggestion if current panel is clicked', async () => {
const { instance, lensStore } = await mountWithProvider(
const { instance, lensStore } = await mountWithReduxStore(
<SuggestionPanel {...defaultProps} />
);

Expand All @@ -261,7 +261,7 @@ describe('suggestion_panel', () => {
});

it('should dispatch visualization switch action if suggestion is clicked', async () => {
const { instance, lensStore } = await mountWithProvider(<SuggestionPanel {...defaultProps} />, {
const { instance, lensStore } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />, {
preloadedState,
});

Expand Down Expand Up @@ -315,7 +315,7 @@ describe('suggestion_panel', () => {

mockDatasource.toExpression.mockReturnValue('datasource_expression');

const { instance } = await mountWithProvider(<SuggestionPanel {...defaultProps} />, {
const { instance } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />, {
preloadedState,
});

Expand Down Expand Up @@ -343,14 +343,14 @@ describe('suggestion_panel', () => {
},
};

const { instance } = await mountWithProvider(<SuggestionPanel {...defaultProps} />, {
const { instance } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />, {
preloadedState: newPreloadedState,
});
expect(instance.html()).toEqual(null);
});

it('should hide the selections when the accordion is hidden', async () => {
const { instance } = await mountWithProvider(<SuggestionPanel {...defaultProps} />);
const { instance } = await mountWithReduxStore(<SuggestionPanel {...defaultProps} />);
expect(instance.find(EuiAccordion)).toHaveLength(1);
act(() => {
instance.find(EuiAccordion).at(0).simulate('change');
Expand Down Expand Up @@ -385,7 +385,7 @@ describe('suggestion_panel', () => {
.mockReturnValueOnce('test | expression');
mockDatasource.toExpression.mockReturnValue('datasource_expression');

mountWithProvider(<SuggestionPanel {...defaultProps} frame={createMockFramePublicAPI()} />);
mountWithReduxStore(<SuggestionPanel {...defaultProps} frame={createMockFramePublicAPI()} />);

expect(expressionRendererMock).toHaveBeenCalledTimes(1);
const passedExpression = (expressionRendererMock as jest.Mock).mock.calls[0][0].expression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
renderWithReduxStore,
} from '../../../mocks';

import { mockDataPlugin, mountWithProvider } from '../../../mocks';
import { mockDataPlugin, mountWithReduxStore } from '../../../mocks';

import { WorkspacePanel } from './workspace_panel';
import { ReactWrapper } from 'enzyme';
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('workspace_panel', () => {

const visualizationShowing = () => instance.exists(expressionRendererMock);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -431,7 +431,7 @@ describe('workspace_panel', () => {
mockDatasource.getLayers.mockReturnValue(['first']);
const props = defaultProps;

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...props}
datasourceMap={{
Expand Down Expand Up @@ -467,7 +467,7 @@ describe('workspace_panel', () => {
mockDatasource.getLayers.mockReturnValue(['first']);
const props = defaultProps;

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...props}
datasourceMap={{
Expand Down Expand Up @@ -505,7 +505,7 @@ describe('workspace_panel', () => {
mockDatasource.getLayers.mockReturnValue(['first']);
const props = defaultProps;

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...props}
datasourceMap={{
Expand Down Expand Up @@ -540,7 +540,7 @@ describe('workspace_panel', () => {
mockDatasource.toExpression.mockReturnValue('datasource');
mockDatasource.getLayers.mockReturnValue(['table1']);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -585,7 +585,7 @@ describe('workspace_panel', () => {

expressionRendererMock = jest.fn((_arg) => <span />);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -629,7 +629,7 @@ describe('workspace_panel', () => {
.mockReturnValueOnce('datasource second');

expressionRendererMock = jest.fn((_arg) => <span />);
const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -687,7 +687,7 @@ describe('workspace_panel', () => {

const getUserMessages = jest.fn(() => messages);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
getUserMessages={getUserMessages}
Expand Down Expand Up @@ -717,7 +717,7 @@ describe('workspace_panel', () => {
let userMessages = [] as UserMessage[];
const getUserMessageFn = jest.fn(() => userMessages);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
getUserMessages={getUserMessageFn}
Expand Down Expand Up @@ -786,7 +786,7 @@ describe('workspace_panel', () => {
const mockAddUserMessages = jest.fn(() => mockRemoveUserMessages);
const mockGetUserMessages = jest.fn<UserMessage[], unknown[]>(() => []);

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -814,7 +814,7 @@ describe('workspace_panel', () => {
first: mockDatasource.publicAPIMock,
};

const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down Expand Up @@ -844,7 +844,7 @@ describe('workspace_panel', () => {
framePublicAPI.datasourceLayers = {
first: mockDatasource.publicAPIMock,
};
const mounted = await mountWithProvider(
const mounted = await mountWithReduxStore(
<WorkspacePanel
{...defaultProps}
datasourceMap={{
Expand Down
2 changes: 1 addition & 1 deletion x-pack/platform/plugins/shared/lens/public/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export {
mockDatasourceStates,
defaultState,
makeLensStore,
mountWithProvider,
mountWithReduxStore,
renderWithReduxStore,
} from './store_mocks';
export { lensPluginMock } from './lens_plugin_mock';
Expand Down
Loading

0 comments on commit e140913

Please sign in to comment.