Skip to content

Commit

Permalink
add comment, extend test.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Dec 1, 2020
1 parent 668e0b1 commit 2a916a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('useResolver', () => {
results: {},
});
expect(addError).toHaveBeenCalledTimes(0);
expect(redirectToJobsManagementPage).toHaveBeenCalledTimes(0);
});

it('should add an error toast and redirect if indexPatternId is an empty string.', async () => {
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugins/ml/public/application/routing/use_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import { useNotifications } from '../contexts/kibana';
import { useCreateAndNavigateToMlLink } from '../contexts/kibana/use_create_url';
import { ML_PAGES } from '../../../common/constants/ml_url_generator';

/**
* Hook to resolve route specific requirements
* @param indexPatternId optional Kibana index pattern id, used for wizards
* @param savedSearchId optional Kibana saved search id, used for wizards
* @param config Kibana UI Settings
* @param resolvers an array of resolvers to be executed for the route
* @return { context, results } returns the ML context and resolver results
*/
export const useResolver = (
indexPatternId: string | undefined,
savedSearchId: string | undefined,
Expand Down

0 comments on commit 2a916a9

Please sign in to comment.