diff --git a/test/functional/apps/discover/_empty_state.ts b/test/functional/apps/discover/_empty_state.ts new file mode 100644 index 0000000000000..e78f5de8bd780 --- /dev/null +++ b/test/functional/apps/discover/_empty_state.ts @@ -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); + }); + }); +} diff --git a/test/functional/apps/discover/index.ts b/test/functional/apps/discover/index.ts index 1241b0e892e9c..b5eb160526876 100644 --- a/test/functional/apps/discover/index.ts +++ b/test/functional/apps/discover/index.ts @@ -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')); }); }