mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Test: add empty test case in sheet utils (#76168)
add empty test case in sheet utils
This commit is contained in:
parent
ef82767dab
commit
69142bffe9
@ -5,6 +5,15 @@ import { DataFrame } from '@grafana/data';
|
|||||||
import { workSheetToFrame } from './sheet';
|
import { workSheetToFrame } from './sheet';
|
||||||
|
|
||||||
describe('sheets', () => {
|
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', () => {
|
it('will use first row as names', () => {
|
||||||
const sheet = utils.aoa_to_sheet([
|
const sheet = utils.aoa_to_sheet([
|
||||||
['Number', 'String', 'Bool', 'Date', 'Object'],
|
['Number', 'String', 'Bool', 'Date', 'Object'],
|
||||||
|
Loading…
Reference in New Issue
Block a user