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

This commit is contained in:
Matthias Wilhelm 2020-06-03 06:41:18 +02:00 committed by GitHub
parent 4c30d912a9
commit 36c6cd9415
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -870,6 +870,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

@ -233,5 +233,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);
});
});
});
}