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

Unified Diff: pkg/polymer_expressions/test/globals_test.dart

Issue 23874018: add enumerate to the default filter set (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « pkg/polymer_expressions/lib/src/mirrors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/test/globals_test.dart
diff --git a/pkg/polymer_expressions/test/globals_test.dart b/pkg/polymer_expressions/test/globals_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..82d7e62d880a2f3bf8ab967fd793fdb9adf8a396
--- /dev/null
+++ b/pkg/polymer_expressions/test/globals_test.dart
@@ -0,0 +1,54 @@
+// 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.
+
+import 'dart:async';
+import 'dart:html';
+
+import 'package:mdv/mdv.dart' as mdv;
+import 'package:observe/observe.dart';
+import 'package:observe/src/microtask.dart';
+import 'package:polymer_expressions/polymer_expressions.dart';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_enhanced_config.dart';
+
+main() {
+ mdv.initialize();
+ useHtmlEnhancedConfiguration();
+
+ var testDiv;
+ group('enumerate', () {
+ setUp(() {
+ testDiv = new Element.html('''
+ <div id="test">
+ <template bind>
+ <template repeat="{{entry in this | enumerate}}">
+ <div>Item {{ entry.index }} is {{ entry.value }}</div>
+ </template>
+ </template>
+ </div>''');
+ document.body.nodes.add(testDiv);
+ });
+
+ tearDown(() {
+ testDiv..unbindAll()..remove();
+ testDiv = null;
+ });
+
+ test('should enumerate item and index', wrapMicrotask(() {
+ testDiv.query('template')
+ ..bindingDelegate = new PolymerExpressions()
+ ..model = toObservable(
+ ['hello', 'from', 'polymer', 'expressions']);
+
+ performMicrotaskCheckpoint();
+
+ expect(testDiv.queryAll('div').map((n) => n.text), [
+ 'Item 0 is hello',
+ 'Item 1 is from',
+ 'Item 2 is polymer',
+ 'Item 3 is expressions',
+ ]);
+ }));
+ });
+}
« no previous file with comments | « pkg/polymer_expressions/lib/src/mirrors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698