import { DimensionsInterface, } from './index'; import { DimensionsModel, } from './dimensions.model'; describe('roundUp', () => { // tslint:disable-next-line test('It returns the width rounded up', () => { const dimensions = { height: 1, width: 1.01, } as DimensionsInterface; expect( DimensionsModel.roundUp( dimensions, ).width, ).toBe(2); }); // tslint:disable-next-line test('It returns the height rounded up', () => { const dimensions = { height: 1.01, width: 1, } as DimensionsInterface; expect( DimensionsModel.roundUp( dimensions, ).height, ).toBe(2); }); // tslint:disable-next-line test('It returns the same values if height and width are integers', () => { const dimensions = { height: 1, width: 1, } as DimensionsInterface; expect( DimensionsModel.roundUp( dimensions, ), ).toEqual(dimensions); }); // tslint:disable-next-line test('It returns a new object', () => { const dimensions = { height: 1.01, width: 1.01, } as DimensionsInterface; expect( DimensionsModel.roundUp( dimensions, ), ).not.toBe(dimensions); }); });