mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-19 10:28:10 +00:00
migrate more tests to htmlRunner
This commit is contained in:
21
src/tests/html/template.html
Normal file
21
src/tests/html/template.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<script src="../testing.js"></script>
|
||||
|
||||
<div id=c></div>
|
||||
|
||||
<script id=template>
|
||||
let t = document.createElement('template');
|
||||
let d = document.createElement('div');
|
||||
d.id = 'abc';
|
||||
t.content.append(d);
|
||||
|
||||
testing.expectEqual(null, document.getElementById('abc'));
|
||||
document.getElementById('c').appendChild(t.content.cloneNode(true));
|
||||
testing.expectEqual('abc', document.getElementById('abc').id);
|
||||
|
||||
t.innerHTML = '<span>over</span><p>9000!</p>';
|
||||
testing.expectEqual(2, t.content.childNodes.length);
|
||||
testing.expectEqual('SPAN', t.content.childNodes[0].tagName);
|
||||
testing.expectEqual('over', t.content.childNodes[0].innerHTML);
|
||||
testing.expectEqual('P', t.content.childNodes[1].tagName);
|
||||
testing.expectEqual('9000!', t.content.childNodes[1].innerHTML);
|
||||
</script>
|
||||
Reference in New Issue
Block a user