import { getIsEmpty,isAbsentCellValue, isEmptyCellValue } from './cells'; describe('isAbsentCellValue', () => { test.each([false, '', [], NaN])('%p is NOT an absent cell value', (value) => { expect(isAbsentCellValue(value)).toBe(false); }); test.each([null, undefined])('%p IS an absent cell value', (value) => { expect(isAbsentCellValue(value)).toBe(true); }); }); describe('isEmptyCellValue', () => { test.each([0, 1, 'foo', true, false, ['foo']])( '%p is NOT an empty cell value', (value) => { expect(isEmptyCellValue(value)).toBe(false); } ); test.each([null, undefined, '', [], NaN])( '%p IS an empty cell value', (value) => { expect(isEmptyCellValue(value)).toBe(true); } ); }); describe('getIsEmpty', () => { test.each([0, 1, 'foo', true, false, ['foo']])( '%p is NOT an empty cell value', (value) => { expect(getIsEmpty(value)).toBe(false); } ); test.each([null, undefined, '', []])('%p IS an empty cell value', (value) => { expect(getIsEmpty(value)).toBe(true); }); // undefined needed here so jest tests "[{ fileId: '' }]" instead of "{ fileId: '' }" test.each([undefined, [{ fileId: '' }], [{ visibleName: '' }]])( '%o IS an empty cell value', (value) => { expect(getIsEmpty(value)).toBe(true); } ); });