Index: sky/tests/dom/inherit-from-text.sky |
diff --git a/sky/tests/dom/inherit-from-text.sky b/sky/tests/dom/inherit-from-text.sky |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ffede0634a24a9f74376284ac92d250f2cfc84a8 |
--- /dev/null |
+++ b/sky/tests/dom/inherit-from-text.sky |
@@ -0,0 +1,31 @@ |
+<sky> |
+<script> |
+import "../resources/third_party/unittest/unittest.dart"; |
+import "../resources/unit.dart"; |
+ |
+import "dart:sky"; |
+ |
+class CustomText extends Text { |
+ CustomText() : super("awesome"); |
+ |
+ bool get isCustom => true; |
+} |
+ |
+void main() { |
+ initUnit(); |
+ |
+ test("should be able to insert in DOM", () { |
+ var child = new CustomText(); |
+ expect(child.isCustom, isTrue); |
+ expect(child.parentNode, isNull); |
+ expect(child.data, equals("awesome")); |
+ |
+ var parent = document.createElement("div"); |
+ parent.appendChild(child); |
+ expect(child.parentNode, equals(parent)); |
+ expect(parent.firstChild, equals(child)); |
+ expect(parent.firstChild.isCustom, isTrue); |
+ }); |
+} |
+</script> |
+</sky> |