test: test for table stringification bail

This commit is contained in:
Evan You 2020-06-09 17:10:07 -04:00
parent a938b61edc
commit 3f80183f1f

View File

@ -249,4 +249,17 @@ describe('stringify static html', () => {
type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
}) })
}) })
test('should bail on break content with innerHTML (eg.tables related tags)', () => {
const { ast } = compileWithStringify(
`<table><tbody>${repeat(
`<tr class="foo"><td>foo</td></tr>`,
StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
)}</tbody></table>`
)
expect(ast.hoists.length).toBe(1)
expect(ast.hoists[0]).toMatchObject({
type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
})
})
}) })