Skip to content

Commit

Permalink
add FTR test
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Apr 27, 2020
1 parent 08d81af commit 5122bbb
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import url from 'url';
import expect from '@kbn/expect';
import {
AppNavLinkStatus,
Expand All @@ -26,6 +27,15 @@ import {
import { PluginFunctionalProviderContext } from '../../services';
import '../../plugins/core_app_status/public/types';

const getKibanaUrl = (pathname?: string, search?: string) =>
url.format({
protocol: 'http:',
hostname: process.env.TEST_KIBANA_HOST || 'localhost',
port: process.env.TEST_KIBANA_PORT || '5620',
pathname,
search,
});

// eslint-disable-next-line import/no-default-export
export default function({ getService, getPageObjects }: PluginFunctionalProviderContext) {
const PageObjects = getPageObjects(['common']);
Expand Down Expand Up @@ -97,6 +107,22 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
expect(await testSubjects.exists('appStatusApp')).to.eql(true);
});

it('allows to change the defaultPath of an application', async () => {
let link = await appsMenu.getLink('App Status');
expect(link!.href).to.eql(getKibanaUrl('/app/app_status'));

await setAppStatus({
defaultPath: '/arbitrary/path',
});

link = await appsMenu.getLink('App Status');
expect(link!.href).to.eql(getKibanaUrl('/app/app_status/arbitrary/path'));

await navigateToApp('app_status');
expect(await testSubjects.exists('appStatusApp')).to.eql(true);
expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/app_status/arbitrary/path'));
});

it('can change the state of the currently mounted app', async () => {
await setAppStatus({
status: AppStatus.accessible,
Expand Down

0 comments on commit 5122bbb

Please sign in to comment.