| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <!-- | |
| 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 4 for details. All rights reserved. Use of this source code is governed by a | |
| 5 BSD-style license that can be found in the LICENSE file. | |
| 6 --> | |
| 7 <html lang="en"> | |
| 8 <head> | |
| 9 <!-- | |
| 10 This test runs the TodoMVC app, adds a few elements, marks some as done, and | |
| 11 switches from back and forth between "Active" and "All". This will make some | |
| 12 nodes to be hidden and readded to the page. | |
| 13 | |
| 14 This is a regression test for a bug in dwc that made the nodes appear in the | |
| 15 wrong order when using lists and ifs together. | |
| 16 --> | |
| 17 <meta charset="utf-8"> | |
| 18 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 19 <link rel="import" href="../web/app.html"> | |
| 20 <link rel="stylesheet" href="../web/base.css"> | |
| 21 <script src="packages/polymer/testing/testing.js"></script> | |
| 22 <title>Dart • TodoMVC</title> | |
| 23 </head> | |
| 24 <body> | |
| 25 <todo-app></todo-app> | |
| 26 <script type="application/dart"> | |
| 27 import 'dart:html'; | |
| 28 import 'package:polymer/polymer.dart'; | |
| 29 import 'package:unittest/unittest.dart'; | |
| 30 import '../web/model.dart'; | |
| 31 | |
| 32 main() { | |
| 33 appModel.todos.add(new Todo('one (unchecked)')); | |
| 34 appModel.todos.add(new Todo('two (checked)')..done = true); | |
| 35 appModel.todos.add(new Todo('three (unchecked)')); | |
| 36 | |
| 37 var root = query('todo-app').xtag.shadowRoot; | |
| 38 | |
| 39 windowLocation.hash = '#/'; | |
| 40 performMicrotaskCheckpoint(); | |
| 41 | |
| 42 expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); | |
| 43 windowLocation.hash = '#/active'; | |
| 44 performMicrotaskCheckpoint(); | |
| 45 | |
| 46 expect(root.queryAll('#todo-list li[is=todo-row]').length, 2); | |
| 47 windowLocation.hash = '#/completed'; | |
| 48 performMicrotaskCheckpoint(); | |
| 49 | |
| 50 expect(root.queryAll('#todo-list li[is=todo-row]').length, 1); | |
| 51 windowLocation.hash = '#/'; | |
| 52 performMicrotaskCheckpoint(); | |
| 53 | |
| 54 window.postMessage('done', '*'); | |
| 55 } | |
| 56 </script> | |
| 57 </body> | |
| 58 </html> | |
| OLD | NEW |