Fix getChildElements.
It was returing all element descendants instead of all element immediate children. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1048333006
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
CONSOLE: unittest-suite-wait-for-done
|
||||
CONSOLE: PASS: getChildElements should only include immediate children
|
||||
CONSOLE:
|
||||
CONSOLE: All 1 tests passed.
|
||||
CONSOLE: unittest-suite-success
|
||||
DONE
|
||||
26
engine/src/flutter/tests/dom/getChildElements.sky
Normal file
26
engine/src/flutter/tests/dom/getChildElements.sky
Normal file
@@ -0,0 +1,26 @@
|
||||
<parent>
|
||||
<child1>
|
||||
<grandchild />
|
||||
</child1>
|
||||
<child2 />
|
||||
</parent>
|
||||
|
||||
<script>
|
||||
import "../resources/third_party/unittest/unittest.dart";
|
||||
import "../resources/unit.dart";
|
||||
|
||||
import "dart:sky";
|
||||
|
||||
void main() {
|
||||
initUnit();
|
||||
|
||||
test("getChildElements should only include immediate children", () {
|
||||
var parent = document.querySelector('parent');
|
||||
var children = parent.getChildElements();
|
||||
expect(children.length, equals(2));
|
||||
expect(children[0], equals(document.querySelector('child1')));
|
||||
expect(children[1], equals(document.querySelector('child2')));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</sky>
|
||||
Reference in New Issue
Block a user