mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Use default index pattern when one is not present in visualize (#30574)
* Use default index pattern when one is not present in visualize * Review feedback * Add functional test * Fix test * Attempt to fix test again * Try moving test to its own describe
This commit is contained in:
parent
76654b548f
commit
3639f4c972
2 changed files with 18 additions and 2 deletions
|
@ -119,6 +119,7 @@ function VisEditor(
|
|||
AppState,
|
||||
$window,
|
||||
$injector,
|
||||
indexPatterns,
|
||||
kbnUrl,
|
||||
redirectWhenMissing,
|
||||
Private,
|
||||
|
@ -313,7 +314,14 @@ function VisEditor(
|
|||
function init() {
|
||||
// export some objects
|
||||
$scope.savedVis = savedVis;
|
||||
$scope.indexPattern = vis.indexPattern;
|
||||
if (vis.indexPattern) {
|
||||
$scope.indexPattern = vis.indexPattern;
|
||||
} else {
|
||||
indexPatterns.getDefault().then(defaultIndexPattern => {
|
||||
$scope.indexPattern = defaultIndexPattern;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.searchSource = searchSource;
|
||||
$scope.state = $state;
|
||||
|
||||
|
|
|
@ -43,11 +43,19 @@ export default function ({ getService, getPageObjects }) {
|
|||
await PageObjects.visualize.clickGo();
|
||||
});
|
||||
|
||||
|
||||
it('should not have inspector enabled', async function () {
|
||||
await inspector.expectIsNotEnabled();
|
||||
});
|
||||
|
||||
describe('filter bar', () => {
|
||||
it('should show the default index pattern when clicking "Add filter"', async () => {
|
||||
await testSubjects.click('addFilter');
|
||||
const fields = await filterBar.getFilterEditorFields();
|
||||
await filterBar.ensureFieldEditorModalIsClosed();
|
||||
expect(fields.length).to.be.greaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('updateFiltersOnChange is false', () => {
|
||||
|
||||
it('should contain dropdown with terms aggregation results as options', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue