Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VasilyStrelyaev committed Mar 15, 2023
1 parent 809a1e0 commit 5a19c89
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
getWidthInPixels,
getViewCellKey,
getResourceColor,
getEmptyCellWidth,
} from './utils';

describe('Utils', () => {
Expand Down Expand Up @@ -42,4 +43,12 @@ describe('Utils', () => {
.toBe('Main color');
});
});
describe('#getEmptyCellWidth', () => {
it('should return the exact width as a string (if provided)', () => {
expect(getEmptyCellWidth(undefined, 81, 91)).toBe('81px');
});
it('should ask the theme to calculate the width if none was provided and return it as a calc function that also adds one pixel', () => {
expect(getEmptyCellWidth({ spacing: width => `${width * 10}px` }, undefined, 8)).toBe('calc(80px + 1px)');
});
});
});

0 comments on commit 5a19c89

Please sign in to comment.