UNPKG

@wix/design-system

Version:

@wix/design-system

46 lines (45 loc) 1.5 kB
"use strict"; var _formatSizeValues = require("./formatSizeValues"); describe('format size', () => { describe('formatSizeValues', () => { it('should convert value correctly when value is string `123`', () => { var result = (0, _formatSizeValues.formatSizeValue)('123'); expect(result).toBe('123px'); }); it('should convert value correctly when value is string `234px`', () => { var result = (0, _formatSizeValues.formatSizeValue)('234px'); expect(result).toBe('234px'); }); it('should convert value correctly when value is number 345', () => { var result = (0, _formatSizeValues.formatSizeValue)(345); expect(result).toBe('345px'); }); it('should convert value correctly when value is `100%`', () => { var result = (0, _formatSizeValues.formatSizeValue)('100%'); expect(result).toBe('100%'); }); }); describe('getSizeValues', () => { it('should return correct values', () => { var props = { minWidth: 600, maxWidth: 1200, width: '660', minHeight: '360px', maxHeight: '100%', height: 400 }; var expected = { minWidth: '600px', maxWidth: '1200px', width: '660px', minHeight: '360px', maxHeight: '100%', height: '400px' }; var result = (0, _formatSizeValues.getSizeValues)(props); expect(result).toEqual(expected); }); }); }); //# sourceMappingURL=formatSizeValues.spec.js.map