Skip to content

Commit fb678dd

Browse files
committed
test(runtime-vapor): add tests for template parsing behavior
1 parent 753f6e4 commit fb678dd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/runtime-vapor/__tests__/dom/template.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,22 @@ describe('api: template', () => {
4040
expect(nthChild(root, 2)).toBe(root.childNodes[2])
4141
expect(next(b)).toBe(root.childNodes[2])
4242
})
43+
44+
describe('tag closure omission', () => {
45+
test('final close tags', () => {
46+
const t = template('<div><span>')
47+
const root = t() as HTMLElement
48+
const html = root.outerHTML
49+
50+
expect(html).toBe('<div><span></span></div>')
51+
})
52+
53+
test('wrapped non-formatting tag closure', () => {
54+
const t = template('<div><div><span></div><div>')
55+
const root = t() as HTMLElement
56+
const html = root.outerHTML
57+
58+
expect(html).toBe('<div><div><span></span></div><div></div></div>')
59+
})
60+
})
4361
})

0 commit comments

Comments
 (0)