From 309dea58996cf1901417f79c70192b665c8b1239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre=20=E2=9C=8F?= Date: Sun, 4 Sep 2016 19:42:07 +0200 Subject: [PATCH] Ensure that text outside of the root el is emitted --- lib/prototype/parse.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/prototype/parse.test.js b/lib/prototype/parse.test.js index b64cabd..6c1d23d 100644 --- a/lib/prototype/parse.test.js +++ b/lib/prototype/parse.test.js @@ -143,6 +143,19 @@ test('should parse text nodes', assert => { ); }); +test('should parse text nodes outside of the root element', assert => { + expectEvents(assert, + 'beforeinsideafter', + [ + ['text', {contents: 'before'}], + ['tagopen', {name: 'root', attrs: '', isSelfClosing: false}], + ['text', {contents: 'inside'}], + ['tagclose', {name: 'root'}], + ['text', {contents: 'after'}] + ] + ); +}); + test('should parse a complete document', assert => { expectEvents(assert, tags.stripIndent`