Is this test correct?

pull/3024/head
qintarp 6 years ago
parent f18ad5e6f6
commit 4f61dfc338

@ -1,8 +1,16 @@
export default { export default {
html: `<div>hello&nbsp;</div>`, html: `<div>&nbsp;hello</div>
<div>&nbsp;hello&nbsp;</div>
<div>&nbsp;hello&nbsp;hello</div>`,
test({ assert, component, target }) { test({ assert, component, target }) {
const text = target.querySelector( 'div' ).textContent; var divList = target.querySelectorAll('div')
assert.equal( text.charCodeAt( 5 ), 160 ); 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 );
} }
}; };

@ -2,5 +2,6 @@
let name = 'hello'; let name = 'hello';
</script> </script>
<div>&nbsp;{name}</div>
<div>{name}&nbsp;</div> <div>&nbsp;{name}&nbsp;&nbsp;</div>
<div>&nbsp;{name}&nbsp;&nbsp;{name}</div>
Loading…
Cancel
Save