mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
20 lines
539 B
TypeScript
20 lines
539 B
TypeScript
import { roundTen } from '../../../shlink-web-component/src/utils/helpers/numbers';
|
|
|
|
describe('numbers', () => {
|
|
describe('roundTen', () => {
|
|
it('rounds provided number to the next multiple of ten', () => {
|
|
const expectationsPairs = [
|
|
[10, 10],
|
|
[12, 20],
|
|
[158, 160],
|
|
[5, 10],
|
|
[-42, -40],
|
|
];
|
|
|
|
expect.assertions(expectationsPairs.length);
|
|
expectationsPairs.forEach(([number, expected]) => {
|
|
expect(roundTen(number)).toEqual(expected);
|
|
});
|
|
});
|
|
});
|
|
});
|