Test: add empty test case in sheet utils (#76168)

add empty test case in sheet utils
pull/76049/head^2
Krishna Dhakal 2 years ago committed by GitHub
parent ef82767dab
commit 69142bffe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      public/app/core/utils/sheet.test.ts

@ -5,6 +5,15 @@ import { DataFrame } from '@grafana/data';
import { workSheetToFrame } from './sheet';
describe('sheets', () => {
it('should handle an empty sheet', () => {
const emptySheet = utils.aoa_to_sheet([]);
const frame = workSheetToFrame(emptySheet);
expect(frame.name).toBeUndefined();
expect(frame.fields).toHaveLength(0);
expect(frame.length).toBe(0);
});
it('will use first row as names', () => {
const sheet = utils.aoa_to_sheet([
['Number', 'String', 'Bool', 'Date', 'Object'],

Loading…
Cancel
Save