-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…22851) * [APM] Fix broken links (#22592) * [APM] Fix broken links * Add missing basepaths * Remove basepath from getMlJobUrl * [APM] Fix ML links (#22820)
- Loading branch information
Showing
11 changed files
with
316 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ugins/apm/public/components/app/ErrorGroupOverview/Watcher/__test__/WatcherButton.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import DetailView from '../WatcherButton'; | ||
|
||
jest.mock('ui/chrome', () => ({ | ||
addBasePath: path => `myBasePath${path}` | ||
})); | ||
|
||
describe('WatcherButton', () => { | ||
let wrapper; | ||
beforeEach(() => { | ||
wrapper = shallow(<DetailView />); | ||
}); | ||
|
||
it('should render initial state', () => { | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it('should have correct url', () => { | ||
const panels = wrapper.find('EuiContextMenu').prop('panels'); | ||
expect(panels[0].items[1].href).toBe( | ||
'myBasePath/app/kibana#/management/elasticsearch/watcher/' | ||
); | ||
}); | ||
|
||
it('popover should be closed', () => { | ||
expect(wrapper.find('EuiPopover').prop('isOpen')).toBe(false); | ||
}); | ||
|
||
it('should open popover', async () => { | ||
await wrapper.instance().onButtonClick(); | ||
wrapper.update(); | ||
expect(wrapper.find('EuiPopover').prop('isOpen')).toBe(true); | ||
}); | ||
}); |
53 changes: 53 additions & 0 deletions
53
...mponents/app/ErrorGroupOverview/Watcher/__test__/__snapshots__/WatcherButton.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`WatcherButton should render initial state 1`] = ` | ||
<EuiPopover | ||
anchorPosition="downRight" | ||
button={ | ||
<EuiButton | ||
color="primary" | ||
fill={false} | ||
iconSide="right" | ||
iconType="arrowDown" | ||
onClick={[Function]} | ||
size="s" | ||
type="button" | ||
> | ||
Integrations | ||
</EuiButton> | ||
} | ||
closePopover={[Function]} | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
> | ||
<EuiContextMenu | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"icon": <EuiIcon | ||
size="m" | ||
type="plusInCircle" | ||
/>, | ||
"name": "Enable error reports", | ||
"onClick": [Function], | ||
}, | ||
Object { | ||
"href": "myBasePath/app/kibana#/management/elasticsearch/watcher/", | ||
"icon": "tableOfContents", | ||
"name": "View existing watches", | ||
"onClick": [Function], | ||
"target": "_blank", | ||
}, | ||
], | ||
"title": "Watcher", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ins/apm/public/components/app/TransactionOverview/DynamicBaseline/__jest__/Button.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import DetailView from '../Button'; | ||
|
||
jest.mock('ui/chrome', () => ({ | ||
addBasePath: path => `myBasePath${path}` | ||
})); | ||
|
||
describe('MLButton', () => { | ||
let wrapper; | ||
beforeEach(() => { | ||
wrapper = shallow(<DetailView />); | ||
}); | ||
|
||
it('should render initial state', () => { | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it('should have correct url', () => { | ||
const panels = wrapper.find('EuiContextMenu').prop('panels'); | ||
expect(panels[0].items[1].href).toBe('myBasePath/app/ml'); | ||
}); | ||
|
||
it('popover should be closed', () => { | ||
expect(wrapper.find('EuiPopover').prop('isOpen')).toBe(false); | ||
}); | ||
|
||
it('should open popover', async () => { | ||
await wrapper.instance().onButtonClick(); | ||
wrapper.update(); | ||
expect(wrapper.find('EuiPopover').prop('isOpen')).toBe(true); | ||
}); | ||
}); |
53 changes: 53 additions & 0 deletions
53
...onents/app/TransactionOverview/DynamicBaseline/__jest__/__snapshots__/Button.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`MLButton should render initial state 1`] = ` | ||
<EuiPopover | ||
anchorPosition="downRight" | ||
button={ | ||
<EuiButton | ||
color="primary" | ||
fill={false} | ||
iconSide="right" | ||
iconType="arrowDown" | ||
onClick={[Function]} | ||
size="s" | ||
type="button" | ||
> | ||
Integrations | ||
</EuiButton> | ||
} | ||
closePopover={[Function]} | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
> | ||
<EuiContextMenu | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"icon": <EuiIcon | ||
size="m" | ||
type="stats" | ||
/>, | ||
"name": "Anomaly detection (BETA)", | ||
"onClick": [Function], | ||
}, | ||
Object { | ||
"href": "myBasePath/app/ml", | ||
"icon": "tableOfContents", | ||
"name": "View existing jobs", | ||
"onClick": [Function], | ||
"target": "_blank", | ||
}, | ||
], | ||
"title": "Machine Learning", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.