Index: runtime/observatory/tests/observatory_ui/error_ref_test.dart |
diff --git a/runtime/observatory/tests/observatory_ui/error_ref_test.dart b/runtime/observatory/tests/observatory_ui/error_ref_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..600aa1ea961aa792f4963cd7d5cf284b1c86f933 |
--- /dev/null |
+++ b/runtime/observatory/tests/observatory_ui/error_ref_test.dart |
@@ -0,0 +1,34 @@ |
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+import 'dart:html'; |
+import 'package:unittest/unittest.dart'; |
+import 'package:observatory/repositories.dart'; |
+import 'package:observatory/src/elements/error_ref.dart'; |
+ |
+import 'helpers/webcomponents.dart'; |
+ |
+main() async{ |
+ await loadWebComponents(); |
+ ErrorRefElement.tag.ensureRegistration(); |
+ |
+ final ErrorRefMock ref = new ErrorRefMock(id: 'id', message: 'fixed-error-m'); |
+ test('instantiation', () { |
+ final ErrorRefElement e = new ErrorRefElement(ref); |
+ expect(e, isNotNull, reason: 'element correctly created'); |
+ expect(e.error, equals(ref)); |
+ }); |
+ group('elements', () { |
+ test('created after attachment', () { |
+ final ErrorRefElement e = new ErrorRefElement(ref); |
+ expect(e.children.length, isZero, |
+ reason: 'is empty'); |
+ document.body.append(e); |
+ expect(e.children.length, isNonZero, |
+ reason: 'has elements'); |
+ expect(e.innerHtml.contains(ref.message), isTrue, |
+ reason: 'no message in the component'); |
+ e.remove(); |
+ }); |
+ }); |
+} |