mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* Allow to send showLabel parameter with false value * Add unit test
This commit is contained in:
parent
5ca9caf486
commit
c03d1bbbae
3 changed files with 11 additions and 1 deletions
|
@ -26,6 +26,8 @@ exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunct
|
|||
|
||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function without splits or buckets 1`] = `"kibana_table visConfig='{\\"foo\\":\\"bar\\",\\"dimensions\\":{\\"metrics\\":[0,1],\\"buckets\\":[]}}' "`;
|
||||
|
||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tagcloud function with boolean param showLabel 1`] = `"tagcloud metric={visdimension 0} showLabel=false "`;
|
||||
|
||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tagcloud function with buckets 1`] = `"tagcloud metric={visdimension 0} bucket={visdimension 1 } "`;
|
||||
|
||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tagcloud function without buckets 1`] = `"tagcloud metric={visdimension 0} "`;
|
||||
|
|
|
@ -183,6 +183,14 @@ describe('visualize loader pipeline helpers: build pipeline', () => {
|
|||
const actual = buildPipelineVisFunction.tagcloud({ params }, schemas);
|
||||
expect(actual).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('with boolean param showLabel', () => {
|
||||
const schemas = { metric: [{ accessor: 0 }] };
|
||||
const params = { showLabel: false };
|
||||
const actual = buildPipelineVisFunction.tagcloud({ params }, schemas);
|
||||
expect(actual).toMatchSnapshot();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('handles region_map function', () => {
|
||||
|
|
|
@ -267,7 +267,7 @@ export const buildPipelineVisFunction: BuildPipelineVisFunction = {
|
|||
if (maxFontSize) {
|
||||
expr += `maxFontSize=${maxFontSize} `;
|
||||
}
|
||||
if (showLabel) {
|
||||
if (showLabel !== undefined) {
|
||||
expr += `showLabel=${showLabel} `;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue