mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
test(utils): add utils color test (#832)
This commit is contained in:
parent
427003d82b
commit
13e0ce9e26
16
src/_utils/tests/Utils.spec.ts
Normal file
16
src/_utils/tests/Utils.spec.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// import { mount } from '@vue/test-utils'
|
||||||
|
import { createHoverColor, createPressedColor } from '../color'
|
||||||
|
|
||||||
|
describe('color', () => {
|
||||||
|
it('should work with createHoverColor', () => {
|
||||||
|
expect(createHoverColor('#666666')).toBe('rgba(126, 126, 126, 1)')
|
||||||
|
expect(createHoverColor('rgb(42, 148, 125)')).toBe('rgba(76, 165, 146, 1)')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should work with createPressedColor', () => {
|
||||||
|
expect(createPressedColor('#666666')).toBe('rgba(90, 90, 90, 1)')
|
||||||
|
expect(createPressedColor('rgb(42, 148, 125)')).toBe(
|
||||||
|
'rgba(37, 130, 110, 1)'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user