fix: remove superfluous spaces when normalizing class (#3083)

Co-authored-by: Jacek Karczmarczyk <jkarczm@gmail.com>
This commit is contained in:
Albert Kaaman
2021-02-04 14:41:46 +01:00
committed by GitHub
parent 49bc2e4db5
commit 4b551420fc
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import { normalizeClass } from '../src'
describe('normalizeClass', () => {
test('handles string correctly', () => {
expect(normalizeClass('foo')).toEqual('foo')
})
test('handles array correctly', () => {
expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual('foo bar')
})
test('handles object correctly', () => {
expect(normalizeClass({ foo: true, bar: false, baz: true })).toEqual(
'foo baz'
)
})
})