Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: samples/third_party/todomvc/test/mainpage_test.dart

Issue 23539003: Turn on Polymer TodoMVC tests on Dart buildbots (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samples/third_party/todomvc/test/mainpage_test.dart
diff --git a/samples/third_party/todomvc/test/mainpage_test.dart b/samples/third_party/todomvc/test/mainpage_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e1f4dde4f4d5712b52517b52b4f25cdb32df9fe0
--- /dev/null
+++ b/samples/third_party/todomvc/test/mainpage_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library todomvc.test.mainpage_test;
+
+import 'dart:async';
+import 'dart:html';
+import 'package:polymer/polymer.dart';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+import '../web/app.dart';
+import '../web/model.dart';
+
+/**
+ * This test runs the TodoMVC app and checks the state of the initial page.
+ */
+// TODO(jmesserly): verify some styles (colors, fonts, relative size) as well.
+main() {
+ useHtmlConfiguration();
+
+ test('initial state', () {
+ final todoApp = query('todo-app');
+ expect(appModel.todos.length, 0);
+ expect(todoApp.xtag is TodoApp, true, reason: 'TodoApp should bee created');
+
+ final root = todoApp.shadowRoot;
+ final newTodo = root.query('#new-todo');
+ expect(newTodo.placeholder, "What needs to be done?");
+
+ // Wait for setTimeout 0 for focus to activate.
+ Timer.run(expectAsync0(() {
+ expect(document.activeElement, todoApp, reason: 'app should have focus');
+ expect(root.activeElement, newTodo, reason: 'New todo should have focus');
+ expect(root.queryAll('[is=todo-row]').length, 0, reason: 'no items yet');
+ }));
+ });
+}
« no previous file with comments | « samples/third_party/todomvc/test/listorder_test.html ('k') | samples/third_party/todomvc/test/mainpage_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698