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