| 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:html'; | 7 import 'dart:html'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 import 'package:polymer/platform.dart' show endOfMicrotask; |
| 9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 10 import 'package:unittest/html_config.dart'; | 11 import 'package:unittest/html_config.dart'; |
| 11 import '../web/model.dart'; | 12 import '../web/model.dart'; |
| 12 | 13 |
| 13 /** | 14 /** |
| 14 * This test runs the TodoMVC app, adds a few elements, marks some as done, and | 15 * This test runs the TodoMVC app, adds a few elements, marks some as done, and |
| 15 * switches from back and forth between "Active" and "All". This will make some | 16 * switches from back and forth between "Active" and "All". This will make some |
| 16 * nodes to be hidden and readded to the page. | 17 * nodes to be hidden and readded to the page. |
| 17 */ | 18 */ |
| 18 @initMethod | 19 @initMethod |
| 19 _main() { | 20 _main() { |
| 20 useHtmlConfiguration(); | 21 useHtmlConfiguration(); |
| 21 | 22 |
| 22 | |
| 23 ShadowRoot root; | 23 ShadowRoot root; |
| 24 | 24 |
| 25 setUp(() => Polymer.onReady.then((_) { | 25 setUp(() => Polymer.onReady.then((_) { |
| 26 root = query('todo-app').shadowRoot; | 26 root = query('todo-app').shadowRoot; |
| 27 })); | 27 })); |
| 28 | 28 |
| 29 test('programmatically add items to model', () { | 29 test('programmatically add items to model', () { |
| 30 appModel.todos.addAll([ | 30 appModel.todos.addAll([ |
| 31 new Todo('one (unchecked)'), | 31 new Todo('one (unchecked)'), |
| 32 new Todo('two (checked)')..done = true, | 32 new Todo('two (checked)')..done = true, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 58 })); | 58 })); |
| 59 }); | 59 }); |
| 60 | 60 |
| 61 test('navigate back to #/', () { | 61 test('navigate back to #/', () { |
| 62 windowLocation.hash = '#/'; | 62 windowLocation.hash = '#/'; |
| 63 endOfMicrotask(expectAsync0(() { | 63 endOfMicrotask(expectAsync0(() { |
| 64 expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); | 64 expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); |
| 65 })); | 65 })); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| OLD | NEW |