Skip to content

Commit

Permalink
test(utils): getRelativeNumber should ignore whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
seleb committed Nov 17, 2022
1 parent 9f89511 commit 6cda046
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/helpers/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ describe('getRelativeNumber', () => {
expect(getRelativeNumber(0, 5)).toBe(0);
expect(getRelativeNumber(-1, 5)).toBe(-1);
});
it('ignores whitespace', () => {
expect(getRelativeNumber(' +1', 5)).toBe(6);
expect(getRelativeNumber(' +1 ', 5)).toBe(6);
expect(getRelativeNumber('+1 ', 5)).toBe(6);
});
});

describe('clamp', () => {
Expand Down

0 comments on commit 6cda046

Please sign in to comment.