mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +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 {
|
||||
call,
|
||||
createDataKey,
|
||||
formatLength,
|
||||
getTitleAttribute,
|
||||
keysOf,
|
||||
largerSize,
|
||||
smallerSize
|
||||
} from '..'
|
||||
@ -83,4 +85,16 @@ describe('vue', () => {
|
||||
expect(testValue).toBe(3)
|
||||
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