diff --git a/src/_utils/tests/Utils.spec.ts b/src/_utils/tests/Utils.spec.ts index bdf44fb6a..546498147 100644 --- a/src/_utils/tests/Utils.spec.ts +++ b/src/_utils/tests/Utils.spec.ts @@ -1,5 +1,5 @@ -// import { mount } from '@vue/test-utils' import { createHoverColor, createPressedColor } from '../color' +import { formatLength } from '..' describe('color', () => { it('should work with createHoverColor', () => { @@ -14,3 +14,18 @@ describe('color', () => { ) }) }) + +describe('css', () => { + it('should work with formatLength', () => { + expect(formatLength(7)).toBe('7px') + expect(formatLength(2, { offset: 3 })).toBe('5px') + expect(formatLength(3, { offset: 4, c: 2 })).toBe('14px') + expect(formatLength('3')).toBe('3px') + expect(formatLength('3', { attachPx: false })).toBe('3') + expect(formatLength('2', { offset: 3 })).toBe('5px') + expect(formatLength('3', { offset: 4, c: 2 })).toBe('14px') + expect(formatLength('4px')).toBe('4px') + expect(formatLength('2px', { offset: 3 })).toBe('5px') + expect(formatLength('3px', { offset: 4, c: 2 })).toBe('14px') + }) +})