diff --git a/packages/runtime-core/__tests__/rendererElement.spec.ts b/packages/runtime-core/__tests__/rendererElement.spec.ts index ffab39f5e..4e044ad40 100644 --- a/packages/runtime-core/__tests__/rendererElement.spec.ts +++ b/packages/runtime-core/__tests__/rendererElement.spec.ts @@ -1,9 +1,51 @@ +import { + h, + render, + nodeOps, + TestElement, + serializeInner as inner +} from '@vue/runtime-test' + describe('renderer: element', () => { - test.todo('with props') + let root: TestElement - test.todo('with direct text children') + beforeEach(() => { + root = nodeOps.createElement('div') + }) - test.todo('with text node children') + it('should create an element', () => { + render(h('div'), root) + expect(inner(root)).toBe('
') + }) - test.todo('handle already mounted VNode') + it('should create an element with props', () => { + render(h('div', { id: 'foo', class: 'bar' }), root) + expect(inner(root)).toBe('') + }) + + it('should create an element with direct text children', () => { + render(h('div', ['foo', ' ', 'bar']), root) + expect(inner(root)).toBe('