mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 08:48:58 +00:00
migrate more tests to htmlRunner
This commit is contained in:
18
src/tests/dom/named_node_map.html
Normal file
18
src/tests/dom/named_node_map.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div id="content"></div>
|
||||
|
||||
<script src="../testing.js"></script>
|
||||
<script id=namedNodeMap>
|
||||
let a = document.getElementById('content').attributes;
|
||||
testing.expectEqual(1, a.length);
|
||||
testing.expectEqual('[object Attr]', a.item(0).toString());
|
||||
testing.expectEqual(null, a.item(1));
|
||||
testing.expectEqual('[object Attr]', a.getNamedItem('id').toString());
|
||||
testing.expectEqual(null, a.getNamedItem('foo'));
|
||||
testing.expectEqual('[object Attr]', a.setNamedItem(a.getNamedItem('id')).toString());
|
||||
|
||||
testing.expectEqual('id', a['id'].name);
|
||||
testing.expectEqual('content', a['id'].value);
|
||||
testing.expectEqual(undefined, a['other']);
|
||||
a[0].value = 'abc123';
|
||||
testing.expectEqual('abc123', a[0].value);
|
||||
</script>
|
||||
Reference in New Issue
Block a user