]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: test for table stringification bail
authorEvan You <yyx990803@gmail.com>
Tue, 9 Jun 2020 21:10:07 +0000 (17:10 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 9 Jun 2020 21:10:07 +0000 (17:10 -0400)
packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts

index 46fe259177fb3452b31b70620f7fc30e115d7b2b..62d12af7456c3749992e1319965192d943f6ac5d 100644 (file)
@@ -249,4 +249,17 @@ describe('stringify static html', () => {
       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
+    })
+  })
 })