test(utils): add utils color test (#832)

This commit is contained in:
XieZongChen 2021-08-11 09:22:18 -05:00 committed by GitHub
parent 427003d82b
commit 13e0ce9e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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)'
)
})
})