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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer_expressions/lib/src/mirrors.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6 import 'dart:html';
7
8 import 'package:mdv/mdv.dart' as mdv;
9 import 'package:observe/observe.dart';
10 import 'package:observe/src/microtask.dart';
11 import 'package:polymer_expressions/polymer_expressions.dart';
12 import 'package:unittest/unittest.dart';
13 import 'package:unittest/html_enhanced_config.dart';
14
15 main() {
16 mdv.initialize();
17 useHtmlEnhancedConfiguration();
18
19 var testDiv;
20 group('enumerate', () {
21 setUp(() {
22 testDiv = new Element.html('''
23 <div id="test">
24 <template bind>
25 <template repeat="{{entry in this | enumerate}}">
26 <div>Item {{ entry.index }} is {{ entry.value }}</div>
27 </template>
28 </template>
29 </div>''');
30 document.body.nodes.add(testDiv);
31 });
32
33 tearDown(() {
34 testDiv..unbindAll()..remove();
35 testDiv = null;
36 });
37
38 test('should enumerate item and index', wrapMicrotask(() {
39 testDiv.query('template')
40 ..bindingDelegate = new PolymerExpressions()
41 ..model = toObservable(
42 ['hello', 'from', 'polymer', 'expressions']);
43
44 performMicrotaskCheckpoint();
45
46 expect(testDiv.queryAll('div').map((n) => n.text), [
47 'Item 0 is hello',
48 'Item 1 is from',
49 'Item 2 is polymer',
50 'Item 3 is expressions',
51 ]);
52 }));
53 });
54 }
OLDNEW
« 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