OLD | NEW |
(Empty) | |
| 1 import "../resources/third_party/unittest/unittest.dart"; |
| 2 import "../resources/unit.dart"; |
| 3 |
| 4 import "dart:sky"; |
| 5 |
| 6 void main() { |
| 7 initUnit(); |
| 8 |
| 9 test("getChildElements should only include immediate children", () { |
| 10 var doc = new Document(); |
| 11 var parent = doc.createElement('parent'); |
| 12 var child1 = doc.createElement('child1'); |
| 13 var child2 = doc.createElement('child1'); |
| 14 var grandchild = doc.createElement('grandchild'); |
| 15 |
| 16 doc.appendChild(parent); |
| 17 parent.appendChild(child1); |
| 18 parent.appendChild(child2); |
| 19 child1.appendChild(grandchild); |
| 20 |
| 21 var children = parent.getChildElements(); |
| 22 expect(children.length, equals(2)); |
| 23 expect(children[0], equals(child1)); |
| 24 expect(children[1], equals(child2)); |
| 25 }); |
| 26 } |
OLD | NEW |