Skip to content

Commit db8abd2

Browse files
authored
Unskip vislib tests (#71452) (#73203)
1 parent 8ea0417 commit db8abd2

File tree

7 files changed

+493
-637
lines changed

7 files changed

+493
-637
lines changed

src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/vis_type_vislib/public/components/options/metrics_axes/value_axis_options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function ValueAxisOptions({
187187

188188
<LabelOptions
189189
axisLabels={axis.labels}
190-
axisFilterCheckboxName={`yAxisFilterLabelsCheckbox${axis.id}`}
190+
axisFilterCheckboxName={`yAxisFilterLabelsCheckbox-${axis.id}`}
191191
setAxisLabel={setAxisLabel}
192192
/>
193193
</>

test/functional/apps/visualize/_area_chart.js

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export default function ({ getService, getPageObjects }) {
298298
});
299299
});
300300

301-
describe.skip('switch between Y axis scale types', () => {
301+
describe('switch between Y axis scale types', () => {
302302
before(initAreaChart);
303303
const axisId = 'ValueAxis-1';
304304

@@ -308,57 +308,25 @@ export default function ({ getService, getPageObjects }) {
308308
await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log');
309309
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false);
310310
await PageObjects.visEditor.clickGo();
311-
const labels = await PageObjects.visChart.getYAxisLabels();
312-
const expectedLabels = [
313-
'2',
314-
'3',
315-
'5',
316-
'7',
317-
'10',
318-
'20',
319-
'30',
320-
'50',
321-
'70',
322-
'100',
323-
'200',
324-
'300',
325-
'500',
326-
'700',
327-
'1,000',
328-
'2,000',
329-
'3,000',
330-
'5,000',
331-
'7,000',
332-
];
333-
expect(labels).to.eql(expectedLabels);
311+
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
312+
const minLabel = 2;
313+
const maxLabel = 5000;
314+
const numberOfLabels = 10;
315+
expect(labels.length).to.be.greaterThan(numberOfLabels);
316+
expect(labels[0]).to.eql(minLabel);
317+
expect(labels[labels.length - 1]).to.be.greaterThan(maxLabel);
334318
});
335319

336320
it('should show filtered ticks on selecting log scale', async () => {
337321
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true);
338322
await PageObjects.visEditor.clickGo();
339-
const labels = await PageObjects.visChart.getYAxisLabels();
340-
const expectedLabels = [
341-
'2',
342-
'3',
343-
'5',
344-
'7',
345-
'10',
346-
'20',
347-
'30',
348-
'50',
349-
'70',
350-
'100',
351-
'200',
352-
'300',
353-
'500',
354-
'700',
355-
'1,000',
356-
'2,000',
357-
'3,000',
358-
'5,000',
359-
'7,000',
360-
];
361-
expect(labels).to.eql(expectedLabels);
323+
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
324+
const minLabel = 2;
325+
const maxLabel = 5000;
326+
const numberOfLabels = 10;
327+
expect(labels.length).to.be.greaterThan(numberOfLabels);
328+
expect(labels[0]).to.eql(minLabel);
329+
expect(labels[labels.length - 1]).to.be.greaterThan(maxLabel);
362330
});
363331

364332
it('should show ticks on selecting square root scale', async () => {

test/functional/apps/visualize/_line_chart.js

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default function ({ getService, getPageObjects }) {
181181
await PageObjects.visChart.waitForVisualization();
182182
});
183183

184-
describe.skip('switch between Y axis scale types', () => {
184+
describe('switch between Y axis scale types', () => {
185185
before(initLineChart);
186186
const axisId = 'ValueAxis-1';
187187

@@ -191,57 +191,25 @@ export default function ({ getService, getPageObjects }) {
191191
await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log');
192192
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false);
193193
await PageObjects.visEditor.clickGo();
194-
const labels = await PageObjects.visChart.getYAxisLabels();
195-
const expectedLabels = [
196-
'2',
197-
'3',
198-
'5',
199-
'7',
200-
'10',
201-
'20',
202-
'30',
203-
'50',
204-
'70',
205-
'100',
206-
'200',
207-
'300',
208-
'500',
209-
'700',
210-
'1,000',
211-
'2,000',
212-
'3,000',
213-
'5,000',
214-
'7,000',
215-
];
216-
expect(labels).to.eql(expectedLabels);
194+
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
195+
const minLabel = 2;
196+
const maxLabel = 5000;
197+
const numberOfLabels = 10;
198+
expect(labels.length).to.be.greaterThan(numberOfLabels);
199+
expect(labels[0]).to.eql(minLabel);
200+
expect(labels[labels.length - 1]).to.be.greaterThan(maxLabel);
217201
});
218202

219203
it('should show filtered ticks on selecting log scale', async () => {
220204
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true);
221205
await PageObjects.visEditor.clickGo();
222-
const labels = await PageObjects.visChart.getYAxisLabels();
223-
const expectedLabels = [
224-
'2',
225-
'3',
226-
'5',
227-
'7',
228-
'10',
229-
'20',
230-
'30',
231-
'50',
232-
'70',
233-
'100',
234-
'200',
235-
'300',
236-
'500',
237-
'700',
238-
'1,000',
239-
'2,000',
240-
'3,000',
241-
'5,000',
242-
'7,000',
243-
];
244-
expect(labels).to.eql(expectedLabels);
206+
const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers();
207+
const minLabel = 2;
208+
const maxLabel = 5000;
209+
const numberOfLabels = 10;
210+
expect(labels.length).to.be.greaterThan(numberOfLabels);
211+
expect(labels[0]).to.eql(minLabel);
212+
expect(labels[labels.length - 1]).to.be.greaterThan(maxLabel);
245213
});
246214

247215
it('should show ticks on selecting square root scale', async () => {

0 commit comments

Comments
 (0)