merge HTMLAttributes

This commit is contained in:
Philipp Kühn
2020-11-14 17:27:59 +01:00
parent 9d7e022ccb
commit 2a321f6739
4 changed files with 41 additions and 28 deletions

View File

@@ -57,4 +57,13 @@ describe('mergeAttributes', () => {
style: 'color: red; background: green',
})
})
it('should ignore falsy values', () => {
// @ts-expect-error
const value = mergeAttributes(undefined, { class: 'foo' })
expect(value).to.deep.eq({
class: 'foo',
})
})
})