Skip to content

Commit

Permalink
Restore discover histogram selection triggering fetch (elastic#43097)
Browse files Browse the repository at this point in the history
* Listen to timefilter fetch event to start fetching

* Improve functional test to catch error
  • Loading branch information
kertal committed Aug 14, 2019
1 parent ed193f3 commit 376cf57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ function discoverController(
$scope.$listen(timefilter, 'autoRefreshFetch', $scope.fetch);
$scope.$listen(timefilter, 'refreshIntervalUpdate', $scope.updateRefreshInterval);
$scope.$listen(timefilter, 'timeUpdate', $scope.updateTime);
$scope.$listen(timefilter, 'fetch', $scope.fetch);

$scope.$watchCollection('state.sort', function (sort) {
if (!sort) return;
Expand Down
8 changes: 5 additions & 3 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export default function ({ getService, getPageObjects }) {
const time = await PageObjects.timePicker.getTimeConfig();
expect(time.start).to.be('Sep 20, 2015 @ 00:00:00.000');
expect(time.end).to.be('Sep 20, 2015 @ 03:00:00.000');
const rowData = await PageObjects.discover.getDocTableIndex(1);
expect(rowData).to.have.string('Sep 20, 2015 @ 02:57:03.761');
});

it('should modify the time range when the histogram is brushed', async function () {
Expand All @@ -156,9 +158,9 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.waitForVisualization();

const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours();
if (newDurationHours < 1 || newDurationHours >= 5) {
throw new Error(`expected new duration of ${newDurationHours} hours to be between 1 and 5 hours`);
}
expect(Math.round(newDurationHours)).to.be(3);
const rowData = await PageObjects.discover.getDocTableIndex(1);
expect(rowData).to.have.string('Sep 20, 2015 @ 02:56:02.323');
});

it('should show correct initial chart interval of Auto', async function () {
Expand Down

0 comments on commit 376cf57

Please sign in to comment.