Skip to content

Commit

Permalink
Enable _line_chart_split_chart test for new charts library
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Jan 22, 2021
1 parent cad1e20 commit 965824b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
28 changes: 20 additions & 8 deletions test/functional/apps/visualize/_line_chart_split_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false);
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
const minLabel = 2;
const maxLabel = 5000;
const minLabel = await PageObjects.visChart.getExpectedValue(2, 1);
const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 7000);
const numberOfLabels = 10;
expect(labels.length).to.be.greaterThan(numberOfLabels);
expect(labels[0]).to.eql(minLabel);
Expand All @@ -188,8 +188,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true);
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
const minLabel = 2;
const maxLabel = 5000;
const minLabel = await PageObjects.visChart.getExpectedValue(2, 1);
const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 7000);
const numberOfLabels = 10;
expect(labels.length).to.be.greaterThan(numberOfLabels);
expect(labels[0]).to.eql(minLabel);
Expand All @@ -201,7 +201,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false);
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabels();
const expectedLabels = ['0', '2,000', '4,000', '6,000', '8,000', '10,000'];
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['0', '2,000', '4,000', '6,000', '8,000', '10,000'],
['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000']
);

expect(labels).to.eql(expectedLabels);
});
Expand All @@ -210,7 +213,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true);
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabels();
const expectedLabels = ['2,000', '4,000', '6,000', '8,000'];
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['2,000', '4,000', '6,000', '8,000'],
['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000']
);
expect(labels).to.eql(expectedLabels);
});

Expand All @@ -220,15 +226,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabels();
log.debug(labels);
const expectedLabels = ['0', '2,000', '4,000', '6,000', '8,000', '10,000'];
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['0', '2,000', '4,000', '6,000', '8,000', '10,000'],
['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000']
);
expect(labels).to.eql(expectedLabels);
});

it('should show filtered ticks on selecting linear scale', async () => {
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true);
await PageObjects.visEditor.clickGo();
const labels = await PageObjects.visChart.getYAxisLabels();
const expectedLabels = ['2,000', '4,000', '6,000', '8,000'];
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['2,000', '4,000', '6,000', '8,000'],
['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000']
);
expect(labels).to.eql(expectedLabels);
});
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
// Test replaced vislib chart types
loadTestFile(require.resolve('./_area_chart'));
loadTestFile(require.resolve('./_line_chart_split_series'));
loadTestFile(require.resolve('./_line_chart_split_chart'));
loadTestFile(require.resolve('./_point_series_options'));
loadTestFile(require.resolve('./_vertical_bar_chart'));
loadTestFile(require.resolve('./_vertical_bar_chart_nontimeindex'));
Expand Down

0 comments on commit 965824b

Please sign in to comment.