expect(vnode.props).toBe(null)
})
+ test('valid vnode keys', () => {
+ let vnode
+ for (const key in ['', '1', -1, 0, 1, null]) {
+ vnode = createVNode('div', { key })
+ expect(vnode.key).toBe(key)
+ }
+ })
+
describe('class normalization', () => {
test('string', () => {
const vnode = createVNode('p', { class: 'foo baz' })
_isVNode: true,
type,
props,
- key: (props !== null && props.key) || null,
+ key: props !== null && props.key !== undefined ? props.key : null,
ref: (props !== null && props.ref) || null,
scopeId: currentScopeId,
children: null,