UNPKG

multimediaobject

Version:
15 lines (14 loc) 479 B
describe('utils.getUnitFromString', () => { const units = ['%', 'px', 'vh', 'vw', 'em', 'deg']; units.forEach((unit) => { it(`should return ${unit} from '17${unit}'`, () => { expect(utils.getUnitFromString(`17${unit}`)).toEqual(unit); }); }); it("should return px from '17tata'", () => { expect(utils.getUnitFromString('17tata')).toEqual(''); }); it("should return px from ''", () => { expect(utils.getUnitFromString('')).toEqual(''); }); });