Annotations: check for null or undefined fields before conversion (#27712)

This commit is contained in:
Ryan McKinley
2020-09-22 10:45:26 -07:00
committed by GitHub
parent f6c91d1318
commit d46f33c34c
2 changed files with 11 additions and 5 deletions

View File

@@ -5,9 +5,9 @@ describe('DataFrame to annotations', () => {
test('simple conversion', () => {
const frame = toDataFrame({
fields: [
{ type: FieldType.time, values: [1, 2, 3] },
{ name: 'first string field', values: ['t1', 't2', 't3'] },
{ name: 'tags', values: ['aaa,bbb', 'bbb,ccc', 'zyz'] },
{ type: FieldType.time, values: [1, 2, 3, 4, 5] },
{ name: 'first string field', values: ['t1', 't2', 't3', null, undefined] },
{ name: 'tags', values: ['aaa,bbb', 'bbb,ccc', 'zyz', null, undefined] },
],
});
@@ -37,6 +37,12 @@ describe('DataFrame to annotations', () => {
"text": "t3",
"time": 3,
},
Object {
"time": 4,
},
Object {
"time": 5,
},
]
`);
});