* [kbnArchiver] convert archive names to root-relative paths * ensure that newly multiline hooks are explicitly async * missed a newly multiline hook * fix exists check * avoid extra lines by wrapping arrow body in {} * one block more * fix errant `name` variable Co-authored-by: spalger <spalger@users.noreply.github.com>
62 lines
2.6 KiB
TypeScript
62 lines
2.6 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 expect from '@kbn/expect';
|
|
|
|
import { FtrProviderContext } from '../../ftr_provider_context';
|
|
|
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|
const log = getService('log');
|
|
const retry = getService('retry');
|
|
const esArchiver = getService('esArchiver');
|
|
const kibanaServer = getService('kibanaServer');
|
|
const filterBar = getService('filterBar');
|
|
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
|
|
const defaultSettings = {
|
|
defaultIndex: 'logstash-*',
|
|
};
|
|
|
|
describe('discover filter editor', function describeIndexTests() {
|
|
before(async function () {
|
|
log.debug('load kibana index with default index pattern');
|
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
|
|
|
// and load a set of makelogs data
|
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
|
log.debug('discover filter editor');
|
|
await PageObjects.common.navigateToApp('discover');
|
|
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
|
});
|
|
|
|
describe('filter editor', function () {
|
|
it('should add a phrases filter', async function () {
|
|
await filterBar.addFilter('extension.raw', 'is one of', 'jpg');
|
|
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
|
});
|
|
|
|
it('should show the phrases if you re-open a phrases filter', async function () {
|
|
await filterBar.clickEditFilter('extension.raw', 'jpg');
|
|
const phrases = await filterBar.getFilterEditorSelectedPhrases();
|
|
expect(phrases.length).to.be(1);
|
|
expect(phrases[0]).to.be('jpg');
|
|
await filterBar.ensureFieldEditorModalIsClosed();
|
|
});
|
|
|
|
it('should support filtering on nested fields', async () => {
|
|
await filterBar.addFilter('nestedField.child', 'is', 'nestedValue');
|
|
expect(await filterBar.hasFilter('nestedField.child', 'nestedValue')).to.be(true);
|
|
await retry.try(async function () {
|
|
expect(await PageObjects.discover.getHitCount()).to.be('1');
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|