mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
6c50113be0
commit
ae69f51446
1 changed files with 14 additions and 14 deletions
|
@ -17,36 +17,36 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
||||
|
||||
describe('indexpattern without timefield', function () {
|
||||
before(async function () {
|
||||
describe('indexpattern without timefield', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('index_pattern_without_timefield');
|
||||
});
|
||||
|
||||
beforeEach(async function () {
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' });
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
await PageObjects.discover.selectIndexPattern('without-timefield');
|
||||
});
|
||||
|
||||
after(async function unloadMakelogs() {
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_pattern_without_timefield');
|
||||
await kibanaServer.uiSettings.unset('defaultIndex');
|
||||
});
|
||||
|
||||
it('should not display a timepicker', async function () {
|
||||
const timepickerExists = await PageObjects.timePicker.timePickerExists();
|
||||
expect(timepickerExists).to.be(false);
|
||||
it('should not display a timepicker', async () => {
|
||||
if (await PageObjects.timePicker.timePickerExists()) {
|
||||
throw new Error('Expected timepicker not to exist');
|
||||
}
|
||||
});
|
||||
|
||||
it('should display a timepicker after switching to an index pattern with timefield', async function () {
|
||||
expect(await PageObjects.timePicker.timePickerExists()).to.be(false);
|
||||
it('should display a timepicker after switching to an index pattern with timefield', async () => {
|
||||
await PageObjects.discover.selectIndexPattern('with-timefield');
|
||||
expect(await PageObjects.timePicker.timePickerExists()).to.be(true);
|
||||
if (!(await PageObjects.timePicker.timePickerExists())) {
|
||||
throw new Error('Expected timepicker to exist');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue