UNPKG

@wix/design-system

Version:

@wix/design-system

44 lines 1.63 kB
import { formatSizeValue, getSizeValues } from './formatSizeValues'; describe('format size', () => { describe('formatSizeValues', () => { it('should convert value correctly when value is string `123`', () => { const result = formatSizeValue('123'); expect(result).toBe('123px'); }); it('should convert value correctly when value is string `234px`', () => { const result = formatSizeValue('234px'); expect(result).toBe('234px'); }); it('should convert value correctly when value is number 345', () => { const result = formatSizeValue(345); expect(result).toBe('345px'); }); it('should convert value correctly when value is `100%`', () => { const result = formatSizeValue('100%'); expect(result).toBe('100%'); }); }); describe('getSizeValues', () => { it('should return correct values', () => { const props = { minWidth: 600, maxWidth: 1200, width: '660', minHeight: '360px', maxHeight: '100%', height: 400, }; const expected = { minWidth: '600px', maxWidth: '1200px', width: '660px', minHeight: '360px', maxHeight: '100%', height: '400px', }; const result = getSizeValues(props); expect(result).toEqual(expected); }); }); }); //# sourceMappingURL=formatSizeValues.spec.js.map