Skip to content

Commit

Permalink
additional cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
legrego committed Jan 6, 2020
1 parent 307822c commit 1d83015
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,5 @@ describe('CopySavedObjectsToSpaceService', () => {
expect.any(CopyToSpaceSavedObjectsManagementAction)
);
});

it('will not re-register the CopyToSpaceSavedObjectsManagementAction', () => {
const deps = {
spacesManager: spacesManagerMock.create(),
// we don't have a proper NP mock for this yet
managementSetup: ({
savedObjects: {
registry: {
has: jest.fn().mockReturnValue(true),
register: jest.fn(),
},
},
} as unknown) as ManagementSetup,
};

const service = new CopySavedObjectsToSpaceService();
service.setup(deps);

expect(deps.managementSetup.savedObjects.registry.register).toHaveBeenCalledTimes(0);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ interface SetupDeps {
export class CopySavedObjectsToSpaceService {
public setup({ spacesManager, managementSetup }: SetupDeps) {
const action = new CopyToSpaceSavedObjectsManagementAction(spacesManager);
if (!managementSetup.savedObjects.registry.has(action.id)) {
managementSetup.savedObjects.registry.register(action);
}
managementSetup.savedObjects.registry.register(action);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ routes.when('/management/spaces/list', {
k7Breadcrumbs: getListBreadcrumbs,
requireUICapability: 'management.kibana.spaces',
controller($scope: any) {
$scope.$$postDigest(async () => {
$scope.$$postDigest(() => {
const domNode = document.getElementById(reactRootNodeId);

const { spacesManager } = await spacesNPStart;
const { spacesManager } = spacesNPStart;

render(
<I18nContext>
Expand All @@ -83,10 +83,10 @@ routes.when('/management/spaces/create', {
k7Breadcrumbs: getCreateBreadcrumbs,
requireUICapability: 'management.kibana.spaces',
controller($scope: any) {
$scope.$$postDigest(async () => {
$scope.$$postDigest(() => {
const domNode = document.getElementById(reactRootNodeId);

const { spacesManager } = await spacesNPStart;
const { spacesManager } = spacesNPStart;

render(
<I18nContext>
Expand Down

0 comments on commit 1d83015

Please sign in to comment.