From 4f61dfc338aab41ed669482b51591dc40ea73113 Mon Sep 17 00:00:00 2001 From: qintarp Date: Fri, 14 Jun 2019 16:08:48 +0300 Subject: [PATCH] Is this test correct? --- test/runtime/samples/nbsp-div/_config.js | 14 +++++++++++--- test/runtime/samples/nbsp-div/main.svelte | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test/runtime/samples/nbsp-div/_config.js b/test/runtime/samples/nbsp-div/_config.js index e292da9fbb..3114328b9d 100644 --- a/test/runtime/samples/nbsp-div/_config.js +++ b/test/runtime/samples/nbsp-div/_config.js @@ -1,8 +1,16 @@ export default { - html: `
hello 
`, + html: `
 hello
+
 hello 
+
 hello hello
`, test({ assert, component, target }) { - const text = target.querySelector( 'div' ).textContent; - assert.equal( text.charCodeAt( 5 ), 160 ); + var divList = target.querySelectorAll('div') + assert.equal( divList[0].textContent.charCodeAt( 0 ), 160 ); + assert.equal( divList[1].textContent.charCodeAt( 0 ), 160 ); + assert.equal( divList[1].textContent.charCodeAt( 6 ), 160 ); + assert.equal( divList[2].textContent.charCodeAt( 0 ), 160 ); + assert.equal( divList[2].textContent.charCodeAt( 6 ), 160 ); + + } }; \ No newline at end of file diff --git a/test/runtime/samples/nbsp-div/main.svelte b/test/runtime/samples/nbsp-div/main.svelte index dac4b60514..aede3b7ae1 100644 --- a/test/runtime/samples/nbsp-div/main.svelte +++ b/test/runtime/samples/nbsp-div/main.svelte @@ -2,5 +2,6 @@ let name = 'hello'; - -
{name} 
+
 {name}
+
 {name}  
+
 {name}  {name}
\ No newline at end of file