Skip to content

Commit

Permalink
[Discover] Fix missing histogram time range update when query is refr…
Browse files Browse the repository at this point in the history
…eshed (#67582)
  • Loading branch information
kertal committed Jun 3, 2020
1 parent 4c30d91 commit 36c6cd9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
}

0 comments on commit 36c6cd9

Please sign in to comment.