-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Field formats] Fix switching away from duration formatter (#93818)
* simplify field format editor rendering, fixes switching away from duration formatter
- Loading branch information
Showing
3 changed files
with
71 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export default function ({ getService, getPageObjects }) { | ||
const esArchiver = getService('esArchiver'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const browser = getService('browser'); | ||
const PageObjects = getPageObjects(['settings']); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
describe('field formatter', function () { | ||
this.tags(['skipFirefox']); | ||
|
||
before(async function () { | ||
await browser.setWindowSize(1200, 800); | ||
await esArchiver.load('discover'); | ||
await kibanaServer.uiSettings.replace({}); | ||
await kibanaServer.uiSettings.update({}); | ||
}); | ||
|
||
after(async function afterAll() { | ||
await PageObjects.settings.navigateTo(); | ||
await esArchiver.emptyKibanaIndex(); | ||
}); | ||
|
||
describe('set and change field formatter', function describeIndexTests() { | ||
// addresses https://github.com/elastic/kibana/issues/93349 | ||
it('can change format more than once', async function () { | ||
await PageObjects.settings.navigateTo(); | ||
await PageObjects.settings.clickKibanaIndexPatterns(); | ||
await PageObjects.settings.clickIndexPatternLogstash(); | ||
await PageObjects.settings.clickAddField(); | ||
await PageObjects.settings.setFieldType('Long'); | ||
const formatRow = await testSubjects.find('formatRow'); | ||
const formatRowToggle = ( | ||
await formatRow.findAllByCssSelector('[data-test-subj="toggle"]') | ||
)[0]; | ||
|
||
await formatRowToggle.click(); | ||
await PageObjects.settings.setFieldFormat('duration'); | ||
await PageObjects.settings.setFieldFormat('bytes'); | ||
await PageObjects.settings.setFieldFormat('duration'); | ||
await testSubjects.click('euiFlyoutCloseButton'); | ||
await PageObjects.settings.closeIndexPatternFieldEditor(); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters