Skip to content

Commit

Permalink
TableUtils - Test default values
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinorland committed Aug 6, 2018
1 parent 2d97081 commit ed53cb4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/utils/src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ describe('rowsFromArray', () => {
{ one: 'test', two: 'test' },
];

const rows = rowsFromArray(array, fields, false);
let rows = rowsFromArray(array, fields, false);
expect(rows).toEqual([['-', 'two', '-'], ['test', 'two', '-']]);

rows = rowsFromArray(array, fields, true);
expect(rows).toEqual([['test', 'two', '-']]);
});
});

Expand Down Expand Up @@ -124,7 +127,9 @@ describe('arrayHasValueForKeys', () => {
const { arrayHasValueForKeys } = exports;
const keys = ['one', 'two'];
const array = [{}];
const result = arrayHasValueForKeys(array, keys);
let result = arrayHasValueForKeys(array, keys);
expect(result).toBe(false);
result = arrayHasValueForKeys();
expect(result).toBe(false);
});
});
Expand All @@ -142,7 +147,9 @@ describe('objectHasValueForKeys', () => {
const { objectHasValueForKeys } = exports;
const keys = ['one', 'two'];
const item = {};
const result = objectHasValueForKeys(item, keys);
let result = objectHasValueForKeys(item, keys);
expect(result).toBe(false);
result = objectHasValueForKeys();
expect(result).toBe(false);
});
});

0 comments on commit ed53cb4

Please sign in to comment.