mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-07 13:48:31 +08:00
test(utils): add test (#877)
This commit is contained in:
parent
d6ef91dfd6
commit
95d0efa4d3
@ -1,8 +1,10 @@
|
|||||||
import { createHoverColor, createPressedColor } from '../color'
|
import { createHoverColor, createPressedColor } from '../color'
|
||||||
import {
|
import {
|
||||||
call,
|
call,
|
||||||
|
createDataKey,
|
||||||
formatLength,
|
formatLength,
|
||||||
getTitleAttribute,
|
getTitleAttribute,
|
||||||
|
keysOf,
|
||||||
largerSize,
|
largerSize,
|
||||||
smallerSize
|
smallerSize
|
||||||
} from '..'
|
} from '..'
|
||||||
@ -83,4 +85,16 @@ describe('vue', () => {
|
|||||||
expect(testValue).toBe(3)
|
expect(testValue).toBe(3)
|
||||||
expect(testValue2).toBe(4)
|
expect(testValue2).toBe(4)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should work with createDataKey', () => {
|
||||||
|
expect(createDataKey('1')).toBe('s-1')
|
||||||
|
expect(createDataKey(1)).toBe('n-1')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should work with keep', () => {
|
||||||
|
const test = { c: 3 }
|
||||||
|
const test2 = { a: 1, b: 2, d: test }
|
||||||
|
expect(keysOf(test).toString()).toBe(['c'].toString())
|
||||||
|
expect(keysOf(test2).toString()).toBe(['a', 'b', 'd'].toString())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user