OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library todomvc.test.markdone_test; | 5 library todomvc.test.markdone_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 14 matching lines...) Expand all Loading... |
25 var r = findWithText(n, text); | 25 var r = findWithText(n, text); |
26 if (r != null) return r; | 26 if (r != null) return r; |
27 } | 27 } |
28 return null; | 28 return null; |
29 } | 29 } |
30 | 30 |
31 /** | 31 /** |
32 * This test runs the TodoMVC app, adds a few todos, marks some as done | 32 * This test runs the TodoMVC app, adds a few todos, marks some as done |
33 * programatically, and clicks on a checkbox to mark others via the UI. | 33 * programatically, and clicks on a checkbox to mark others via the UI. |
34 */ | 34 */ |
35 @initMethod | |
36 main() { | 35 main() { |
| 36 initPolymer(); |
37 useHtmlConfiguration(); | 37 useHtmlConfiguration(); |
38 | 38 |
39 TodoModel model; | 39 TodoModel model; |
40 | 40 |
41 setUp(() => Polymer.onReady.then((_) { | 41 setUp(() => Polymer.onReady.then((_) { |
42 model = querySelector('td-model'); | 42 model = querySelector('td-model'); |
43 return onPropertyInit(model, 'items'); | 43 return onPropertyInit(model, 'items'); |
44 })); | 44 })); |
45 | 45 |
46 test('mark done', () { | 46 test('mark done', () { |
(...skipping 13 matching lines...) Expand all Loading... |
60 var node = host.querySelector('input'); | 60 var node = host.querySelector('input'); |
61 expect(node is InputElement, true, reason: 'node is a checkbox'); | 61 expect(node is InputElement, true, reason: 'node is a checkbox'); |
62 expect(node.type, 'checkbox', reason: 'node type is checkbox'); | 62 expect(node.type, 'checkbox', reason: 'node type is checkbox'); |
63 expect(node.checked, isFalse, reason: 'element is unchecked'); | 63 expect(node.checked, isFalse, reason: 'element is unchecked'); |
64 | 64 |
65 node.dispatchEvent(new MouseEvent('click', detail: 1)); | 65 node.dispatchEvent(new MouseEvent('click', detail: 1)); |
66 expect(node.checked, true, reason: 'element is checked'); | 66 expect(node.checked, true, reason: 'element is checked'); |
67 }); | 67 }); |
68 }); | 68 }); |
69 } | 69 } |
OLD | NEW |