Skip to content

Commit 2a916a9

Browse files
committed
add comment, extend test.
1 parent 668e0b1 commit 2a916a9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

x-pack/plugins/ml/public/application/routing/use_resolver.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('useResolver', () => {
7474
results: {},
7575
});
7676
expect(addError).toHaveBeenCalledTimes(0);
77+
expect(redirectToJobsManagementPage).toHaveBeenCalledTimes(0);
7778
});
7879

7980
it('should add an error toast and redirect if indexPatternId is an empty string.', async () => {

x-pack/plugins/ml/public/application/routing/use_resolver.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ import { useNotifications } from '../contexts/kibana';
2020
import { useCreateAndNavigateToMlLink } from '../contexts/kibana/use_create_url';
2121
import { ML_PAGES } from '../../../common/constants/ml_url_generator';
2222

23+
/**
24+
* Hook to resolve route specific requirements
25+
* @param indexPatternId optional Kibana index pattern id, used for wizards
26+
* @param savedSearchId optional Kibana saved search id, used for wizards
27+
* @param config Kibana UI Settings
28+
* @param resolvers an array of resolvers to be executed for the route
29+
* @return { context, results } returns the ML context and resolver results
30+
*/
2331
export const useResolver = (
2432
indexPatternId: string | undefined,
2533
savedSearchId: string | undefined,

0 commit comments

Comments
 (0)