Skip to content

Commit

Permalink
show drop partial buckets option (#25520) (#26116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Nov 26, 2018
1 parent 4911a10 commit c4fd5d3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/controls/drop_partials.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="checkbox" ng-if="agg.params.field.name === agg.vis.indexPattern.timeFieldName">
<div class="checkbox" ng-if="agg.params.field.name === agg.getIndexPattern().timeFieldName">
<label>
<input ng-model="agg.params.drop_partials" type="checkbox">
<input ng-model="agg.params.drop_partials" type="checkbox" data-test-subj="dropPartialBucketsCheckbox">
Drop partial buckets
&nbsp;
<icon-tip
Expand Down
46 changes: 46 additions & 0 deletions test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,56 @@ export default function ({ getService, getPageObjects }) {

await PageObjects.visualize.openInspector();
const data = await PageObjects.visualize.getInspectorTableData();
await PageObjects.visualize.closeInspector();
log.debug(data);
expect(data).to.eql(expectedChartData);
});

it('should have `drop partial buckets` option', async () => {
const fromTime = '2015-09-20 06:31:44.000';
const toTime = '2015-09-22 18:31:44.000';

await PageObjects.header.setAbsoluteRange(fromTime, toTime);

let expectedChartValues = [
82, 218, 341, 440, 480, 517, 522, 446, 403, 321, 258, 172, 95, 55, 38, 24, 3, 4,
11, 14, 17, 38, 49, 115, 152, 216, 315, 402, 446, 513, 520, 474, 421, 307, 230,
170, 99, 48, 30, 15, 10, 2, 8, 7, 17, 34, 37, 104, 153, 241, 313, 404, 492, 512,
503, 473, 379, 293, 277, 156, 56
];

// Most recent failure on Jenkins usually indicates the bar chart is still being drawn?
// return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function
// try sleeping a bit before getting that data
await retry.try(async () => {
const data = await PageObjects.visualize.getBarChartData();
log.debug('data=' + data);
log.debug('data.length=' + data.length);
expect(data).to.eql(expectedChartValues);
});

await PageObjects.visualize.toggleOpenEditor(2);
await PageObjects.visualize.clickDropPartialBuckets();
await PageObjects.visualize.clickGo();

expectedChartValues = [
218, 341, 440, 480, 517, 522, 446, 403, 321, 258, 172, 95, 55, 38, 24, 3, 4,
11, 14, 17, 38, 49, 115, 152, 216, 315, 402, 446, 513, 520, 474, 421, 307, 230,
170, 99, 48, 30, 15, 10, 2, 8, 7, 17, 34, 37, 104, 153, 241, 313, 404, 492, 512,
503, 473, 379, 293, 277, 156
];

// Most recent failure on Jenkins usually indicates the bar chart is still being drawn?
// return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function
// try sleeping a bit before getting that data
await retry.try(async () => {
const data = await PageObjects.visualize.getBarChartData();
log.debug('data=' + data);
log.debug('data.length=' + data.length);
expect(data).to.eql(expectedChartValues);
});
});

describe.skip('switch between Y axis scale types', () => {
before(initBarChart);
const axisId = 'ValueAxis-1';
Expand Down
4 changes: 4 additions & 0 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
defaultFindTimeout * 2);
}

async clickDropPartialBuckets() {
return await testSubjects.click('dropPartialBucketsCheckbox');
}

async setMarkdownTxt(markdownTxt) {
const input = await testSubjects.find('markdownTextarea');
await input.clearValue();
Expand Down

0 comments on commit c4fd5d3

Please sign in to comment.