mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
* implement new test cases for time series formatter
This commit is contained in:
parent
d898d77e6d
commit
b6ae2f7a34
2 changed files with 40 additions and 1 deletions
|
@ -78,7 +78,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(series.length).to.be(2);
|
||||
});
|
||||
|
||||
it('should show the correct count in the legend with custom numeric template', async () => {
|
||||
it('should show the correct count in the legend with custom numeric formatter', async () => {
|
||||
const expectedLegendValue = '$ 156';
|
||||
|
||||
await visualBuilder.clickSeriesOption();
|
||||
|
@ -86,6 +86,33 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const actualCount = await visualBuilder.getRhythmChartLegendValue();
|
||||
expect(actualCount).to.be(expectedLegendValue);
|
||||
});
|
||||
|
||||
it('should show the correct count in the legend with percent formatter', async () => {
|
||||
const expectedLegendValue = '15,600%';
|
||||
|
||||
await visualBuilder.clickSeriesOption();
|
||||
await visualBuilder.changeDataFormatter('Percent');
|
||||
const actualCount = await visualBuilder.getRhythmChartLegendValue();
|
||||
expect(actualCount).to.be(expectedLegendValue);
|
||||
});
|
||||
|
||||
it('should show the correct count in the legend with bytes formatter', async () => {
|
||||
const expectedLegendValue = '156B';
|
||||
|
||||
await visualBuilder.clickSeriesOption();
|
||||
await visualBuilder.changeDataFormatter('Bytes');
|
||||
const actualCount = await visualBuilder.getRhythmChartLegendValue();
|
||||
expect(actualCount).to.be(expectedLegendValue);
|
||||
});
|
||||
|
||||
it('should show the correct count in the legend with duration formatter', async () => {
|
||||
const expectedLegendValue = '156.00';
|
||||
|
||||
await visualBuilder.clickSeriesOption();
|
||||
await visualBuilder.changeDataFormatter('Duration');
|
||||
const actualCount = await visualBuilder.getRhythmChartLegendValue();
|
||||
expect(actualCount).to.be(expectedLegendValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -218,6 +218,18 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
|
|||
await testSubjects.clickWhenNotDisabled('applyBtn');
|
||||
}
|
||||
|
||||
/**
|
||||
* change the data formatter for template in an `options` label tab
|
||||
*
|
||||
* @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter
|
||||
*/
|
||||
public async changeDataFormatter(
|
||||
formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom'
|
||||
) {
|
||||
const [formatterEl] = await find.allByCssSelector('.euiComboBox');
|
||||
await comboBox.setElement(formatterEl, formatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* write template for aggregation row in the `option` tab
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue