mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
test(utils): add css test (#848)
This commit is contained in:
parent
71ec0cb47a
commit
f1fa04f866
@ -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')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user