| 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.listorder_test; | 5 library todomvc.test.listorder_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'; |
| 11 import 'package:unittest/html_config.dart'; | 11 import 'package:unittest/html_config.dart'; |
| 12 import '../web/elements/td_model.dart'; | 12 import '../web/elements/td_model.dart'; |
| 13 import '../web/elements/td_todos.dart'; | 13 import '../web/elements/td_todos.dart'; |
| 14 import 'utils.dart'; | 14 import 'utils.dart'; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * This test runs the TodoMVC app, adds a few elements, marks some as done, and | 17 * This test runs the TodoMVC app, adds a few elements, marks some as done, and |
| 18 * switches from back and forth between "Active" and "All". This will make some | 18 * switches from back and forth between "Active" and "All". This will make some |
| 19 * nodes to be hidden and readded to the page. | 19 * nodes to be hidden and readded to the page. |
| 20 */ | 20 */ |
| 21 @initMethod |
| 21 main() { | 22 main() { |
| 22 initPolymer(); | |
| 23 useHtmlConfiguration(); | 23 useHtmlConfiguration(); |
| 24 | 24 |
| 25 ShadowRoot root; | 25 ShadowRoot root; |
| 26 TodoModel model; | 26 TodoModel model; |
| 27 | 27 |
| 28 setUp(() => Polymer.onReady.then((_) { | 28 setUp(() => Polymer.onReady.then((_) { |
| 29 root = querySelector('td-todos').shadowRoot; | 29 root = querySelector('td-todos').shadowRoot; |
| 30 model = querySelector('td-model'); | 30 model = querySelector('td-model'); |
| 31 return onPropertyInit(model, 'items'); | 31 return onPropertyInit(model, 'items'); |
| 32 })); | 32 })); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 }); | 64 }); |
| 65 }); | 65 }); |
| 66 | 66 |
| 67 test('navigate back to #/', () { | 67 test('navigate back to #/', () { |
| 68 windowLocation.hash = '#/'; | 68 windowLocation.hash = '#/'; |
| 69 return window.animationFrame.then((_) { | 69 return window.animationFrame.then((_) { |
| 70 expect(root.querySelectorAll('#todo-list li[is=td-item]').length, 3); | 70 expect(root.querySelectorAll('#todo-list li[is=td-item]').length, 3); |
| 71 }); | 71 }); |
| 72 }); | 72 }); |
| 73 } | 73 } |
| OLD | NEW |