Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Mar 20, 2024
1 parent 23167ce commit a8de94c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
notificationServiceMock,
savedObjectsServiceMock,
applicationServiceMock,
workspacesServiceMock,
} from '../../../../../core/public/mocks';
import { dataPluginMock } from '../../../../data/public/mocks';
import { serviceRegistryMock } from '../../services/service_registry.mock';
Expand Down Expand Up @@ -102,6 +103,7 @@ describe('SavedObjectsTable', () => {
let notifications: ReturnType<typeof notificationServiceMock.createStartContract>;
let savedObjects: ReturnType<typeof savedObjectsServiceMock.createStartContract>;
let search: ReturnType<typeof dataPluginMock.createStartContract>['search'];
let workspaces: ReturnType<typeof workspacesServiceMock.createStartContract>;

const shallowRender = (overrides: Partial<SavedObjectsTableProps> = {}) => {
return (shallowWithI18nProvider(
Expand All @@ -121,6 +123,7 @@ describe('SavedObjectsTable', () => {
notifications = notificationServiceMock.createStartContract();
savedObjects = savedObjectsServiceMock.createStartContract();
search = dataPluginMock.createStartContract().search;
workspaces = workspacesServiceMock.createStartContract();

const applications = applicationServiceMock.createStartContract();
applications.capabilities = {
Expand Down Expand Up @@ -161,6 +164,7 @@ describe('SavedObjectsTable', () => {
goInspectObject: () => {},
canGoInApp: () => true,
search,
workspaces,
};

findObjectsMock.mockImplementation(() => ({
Expand Down

0 comments on commit a8de94c

Please sign in to comment.