forked from dart-archive/polymer-dart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnested_binding_test.dart
34 lines (25 loc) · 945 Bytes
/
nested_binding_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2013, 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.
library polymer.test.nested_binding_test;
import 'dart:async';
import 'dart:html';
import 'package:polymer/polymer.dart';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
@CustomTag('my-test')
class MyTest extends PolymerElement {
final List fruits = toObservable(['apples', 'oranges', 'pears']);
final _testDone = new Completer();
MyTest.created() : super.created();
ready() {
expect($['fruit'].text.trim(), 'Short name: [pears]');
_testDone.complete();
}
}
main() => initPolymer().then((zone) => zone.run(() {
useHtmlConfiguration();
setUp(() => Polymer.onReady);
test('ready called',
() => (querySelector('my-test') as MyTest)._testDone.future);
}));