2021-02-04 21:41:46 +08:00
|
|
|
import { normalizeClass } from '../src'
|
|
|
|
|
|
|
|
describe('normalizeClass', () => {
|
|
|
|
test('handles string correctly', () => {
|
|
|
|
expect(normalizeClass('foo')).toEqual('foo')
|
|
|
|
})
|
|
|
|
|
|
|
|
test('handles array correctly', () => {
|
2021-07-20 06:24:18 +08:00
|
|
|
expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual(
|
|
|
|
'foo bar'
|
|
|
|
)
|
2021-02-04 21:41:46 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
test('handles object correctly', () => {
|
|
|
|
expect(normalizeClass({ foo: true, bar: false, baz: true })).toEqual(
|
|
|
|
'foo baz'
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|