Skip to content

Commit 5122bbb

Browse files
committed
add FTR test
1 parent 08d81af commit 5122bbb

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/plugin_functional/test_suites/core_plugins/application_status.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import url from 'url';
2021
import expect from '@kbn/expect';
2122
import {
2223
AppNavLinkStatus,
@@ -26,6 +27,15 @@ import {
2627
import { PluginFunctionalProviderContext } from '../../services';
2728
import '../../plugins/core_app_status/public/types';
2829

30+
const getKibanaUrl = (pathname?: string, search?: string) =>
31+
url.format({
32+
protocol: 'http:',
33+
hostname: process.env.TEST_KIBANA_HOST || 'localhost',
34+
port: process.env.TEST_KIBANA_PORT || '5620',
35+
pathname,
36+
search,
37+
});
38+
2939
// eslint-disable-next-line import/no-default-export
3040
export default function({ getService, getPageObjects }: PluginFunctionalProviderContext) {
3141
const PageObjects = getPageObjects(['common']);
@@ -97,6 +107,22 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
97107
expect(await testSubjects.exists('appStatusApp')).to.eql(true);
98108
});
99109

110+
it('allows to change the defaultPath of an application', async () => {
111+
let link = await appsMenu.getLink('App Status');
112+
expect(link!.href).to.eql(getKibanaUrl('/app/app_status'));
113+
114+
await setAppStatus({
115+
defaultPath: '/arbitrary/path',
116+
});
117+
118+
link = await appsMenu.getLink('App Status');
119+
expect(link!.href).to.eql(getKibanaUrl('/app/app_status/arbitrary/path'));
120+
121+
await navigateToApp('app_status');
122+
expect(await testSubjects.exists('appStatusApp')).to.eql(true);
123+
expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/app_status/arbitrary/path'));
124+
});
125+
100126
it('can change the state of the currently mounted app', async () => {
101127
await setAppStatus({
102128
status: AppStatus.accessible,

0 commit comments

Comments
 (0)