Skip to content

Commit

Permalink
finish line
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Sep 23, 2024
1 parent 9e34b32 commit c2ab4e0
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions x-pack/plugins/lens/public/app_plugin/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,26 @@ import faker from 'faker';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { VisualizeEditorContext } from '../types';
// import { LazySavedObjectSaveModalDashboard } from '@kbn/presentation-util-plugin/public';
import { pluginServices as presentationUtilPluginServices } from '@kbn/presentation-util-plugin/public/services';

presentationUtilPluginServices.getHooks = jest.fn().mockReturnValue({
capabilities: {
useService: () => ({
canAccessDashboards: () => true,
canCreateNewDashboards: () => true,
canSaveVisualizations: () => true,
canSetAdvancedSettings: () => true,
}),
},
});

jest.mock('../persistence/saved_objects_utils/check_for_duplicate_title', () => ({
checkForDuplicateTitle: jest.fn(),
}));
jest.mock('lodash', () => ({
...jest.requireActual('lodash'),
debounce: (fn: unknown) => fn,
}));

const defaultSavedObjectId: string = faker.random.uuid();

Expand All @@ -53,11 +68,6 @@ const getLensDocumentMock = (someProps?: Partial<LensDocument>) => ({
...someProps,
});

jest.mock('lodash', () => ({
...jest.requireActual('lodash'),
debounce: (fn: unknown) => fn,
}));

describe('Lens App', () => {
let props: jest.Mocked<LensAppProps>;
let services: jest.Mocked<LensAppServices> = makeDefaultServices(
Expand Down Expand Up @@ -610,7 +620,7 @@ describe('Lens App', () => {
);
});

it.only('saves new docs', async () => {
it('saves new docs', async () => {
await save({
prevSavedObjectId: undefined,
savedObjectId: defaultSavedObjectId,
Expand Down

0 comments on commit c2ab4e0

Please sign in to comment.