mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-07 13:48:31 +08:00
test(utils): add naive's getTitleAttribute test (#856)
This commit is contained in:
parent
f1fa04f866
commit
4b2798c017
@ -1,5 +1,5 @@
|
||||
import { createHoverColor, createPressedColor } from '../color'
|
||||
import { formatLength } from '..'
|
||||
import { formatLength, getTitleAttribute } from '..'
|
||||
|
||||
describe('color', () => {
|
||||
it('should work with createHoverColor', () => {
|
||||
@ -29,3 +29,13 @@ describe('css', () => {
|
||||
expect(formatLength('3px', { offset: 4, c: 2 })).toBe('14px')
|
||||
})
|
||||
})
|
||||
|
||||
describe('naive', () => {
|
||||
it('should work with getTitleAttribute', () => {
|
||||
expect(getTitleAttribute(7)).toBe('7')
|
||||
expect(getTitleAttribute('test')).toBe('test')
|
||||
expect(getTitleAttribute([])).toBe(undefined)
|
||||
expect(getTitleAttribute({})).toBe(undefined)
|
||||
expect(getTitleAttribute(() => '')).toBe(undefined)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user