Skip to content

Commit

Permalink
Add a functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Grubic committed Jan 20, 2022
1 parent 3462216 commit b676f73
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/functional/apps/discover/_empty_state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);

describe('empty state', () => {
before(async () => {
await kibanaServer.uiSettings.unset('defaultIndex');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
});

it('redirects to Overview app', async () => {
await PageObjects.common.navigateToApp('discover');
const selector = await testSubjects.find('kibanaChrome');
const content = await selector.findByCssSelector('.kbnNoDataPageContents');
expect(content).not.to.be(null);
});
});
}
1 change: 1 addition & 0 deletions test/functional/apps/discover/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_search_on_page_load'));
loadTestFile(require.resolve('./_chart_hidden'));
loadTestFile(require.resolve('./_context_encoded_url_param'));
loadTestFile(require.resolve('./_empty_state'));
});
}

0 comments on commit b676f73

Please sign in to comment.