56 lines
2.2 KiB
TypeScript
56 lines
2.2 KiB
TypeScript
/*
|
|
* 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 { FtrProviderContext } from '../../ftr_provider_context';
|
|
|
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|
const esArchiver = getService('esArchiver');
|
|
const kibanaServer = getService('kibanaServer');
|
|
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
|
|
const testSubjects = getService('testSubjects');
|
|
|
|
describe('discover sidebar', function describeIndexTests() {
|
|
before(async function () {
|
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
|
await kibanaServer.uiSettings.replace({
|
|
defaultIndex: 'logstash-*',
|
|
});
|
|
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
|
await PageObjects.common.navigateToApp('discover');
|
|
});
|
|
|
|
after(async () => {
|
|
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
|
|
});
|
|
|
|
describe('field filtering', function () {
|
|
it('should reveal and hide the filter form when the toggle is clicked', async function () {
|
|
await PageObjects.discover.openSidebarFieldFilter();
|
|
await PageObjects.discover.closeSidebarFieldFilter();
|
|
});
|
|
});
|
|
|
|
describe('collapse expand', function () {
|
|
it('should initially be expanded', async function () {
|
|
await testSubjects.existOrFail('discover-sidebar');
|
|
});
|
|
|
|
it('should collapse when clicked', async function () {
|
|
await PageObjects.discover.toggleSidebarCollapse();
|
|
await testSubjects.missingOrFail('discover-sidebar');
|
|
});
|
|
|
|
it('should expand when clicked', async function () {
|
|
await PageObjects.discover.toggleSidebarCollapse();
|
|
await testSubjects.existOrFail('discover-sidebar');
|
|
});
|
|
});
|
|
});
|
|
}
|