mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
4e1d8d2871
commit
0b3c817f69
2 changed files with 11 additions and 1 deletions
|
@ -40,6 +40,11 @@ describe('visualize loader pipeline helpers: build pipeline', () => {
|
|||
const actual = prepareJson('foo', { well: `hello 'hi'`, there: { friend: true } });
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
|
||||
it('returns empty string if data is undefined', () => {
|
||||
const actual = prepareJson('foo', undefined);
|
||||
expect(actual).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('prepareString', () => {
|
||||
|
@ -54,6 +59,11 @@ describe('visualize loader pipeline helpers: build pipeline', () => {
|
|||
const actual = prepareString('foo', `'bar'`);
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
|
||||
it('returns empty string if data is undefined', () => {
|
||||
const actual = prepareString('foo', undefined);
|
||||
expect(actual).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildPipelineVisFunction', () => {
|
||||
|
|
|
@ -192,7 +192,7 @@ export const getSchemas = (vis: Vis, timeRange?: any): Schemas => {
|
|||
return schemas;
|
||||
};
|
||||
|
||||
export const prepareJson = (variable: string, data: object): string => {
|
||||
export const prepareJson = (variable: string, data?: object): string => {
|
||||
if (data === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue