feat(utils): update utils naive test (#857)

This commit is contained in:
XieZongChen 2021-08-12 18:23:44 -05:00 committed by GitHub
parent d7dff4be07
commit a4f29bebaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
import { createHoverColor, createPressedColor } from '../color'
import { formatLength, getTitleAttribute } from '..'
import { formatLength, getTitleAttribute, largerSize, smallerSize } from '..'
describe('color', () => {
it('should work with createHoverColor', () => {
@ -38,4 +38,18 @@ describe('naive', () => {
expect(getTitleAttribute({})).toBe(undefined)
expect(getTitleAttribute(() => '')).toBe(undefined)
})
it('should work with largerSize', () => {
expect(largerSize('tiny')).toBe('small')
expect(largerSize('small')).toBe('medium')
expect(largerSize('medium')).toBe('large')
expect(largerSize('large')).toBe('huge')
})
it('should work with smallerSize', () => {
expect(smallerSize('huge')).toBe('large')
expect(smallerSize('large')).toBe('medium')
expect(smallerSize('medium')).toBe('small')
expect(smallerSize('small')).toBe('tiny')
})
})