[Discover] Fix missing histogram time range update when query is refreshed (#67582) (#68102)

This commit is contained in:
Matthias Wilhelm 2020-06-04 11:11:45 +02:00 committed by GitHub
parent ae69f51446
commit 3610e9ea4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -881,6 +881,7 @@ function discoverController(
if ($scope.vis.data.aggs.aggs[1]) {
$scope.bucketInterval = $scope.vis.data.aggs.aggs[1].buckets.getInterval();
}
$scope.updateTime();
}
$scope.hits = resp.hits.total;

View file

@ -241,5 +241,19 @@ export default function ({ getService, getPageObjects }) {
expect(await PageObjects.discover.getNrOfFetches()).to.be(1);
});
});
describe('empty query', function () {
it('should update the histogram timerange when the query is resubmitted', async function () {
await kibanaServer.uiSettings.update({
'timepicker:timeDefaults': '{ "from": "2015-09-18T19:37:13.000Z", "to": "now"}',
});
await PageObjects.common.navigateToApp('discover');
await PageObjects.header.awaitKibanaChrome();
const initialTimeString = await PageObjects.discover.getChartTimespan();
await queryBar.submitQuery();
const refreshedTimeString = await PageObjects.discover.getChartTimespan();
expect(refreshedTimeString).not.to.be(initialTimeString);
});
});
});
}