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

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

Issue 24096016: PolymerExpressions: fix for null iterators in comprehensions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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: pkg/polymer_expressions/test/syntax_test.dart
diff --git a/pkg/polymer_expressions/test/syntax_test.dart b/pkg/polymer_expressions/test/syntax_test.dart
index 791a02177ea1bdaffc8f1a2c764112142f7c16d4..b361fc095097c83f95b4c52937f362d998e94150 100644
--- a/pkg/polymer_expressions/test/syntax_test.dart
+++ b/pkg/polymer_expressions/test/syntax_test.dart
@@ -15,19 +15,16 @@ main() {
mdv.initialize();
useHtmlEnhancedConfiguration();
- group('syntax', () {
- setUp(() {
- document.body.nodes.add(new Element.html('''
- <template id="test" bind>
- <input id="input" value="{{ firstName }}">
- </template>'''));
- });
-
+ group('PolymerExpressions', () {
tearDown(() {
Jennifer Messerly 2013/09/16 19:43:47 hmm, not sure about this change. Is there a ration
justinfagnani 2013/09/16 20:02:57 Done.
- query('#test')..unbindAll()..remove();
+ document.body.nodes.clear();
});
test('should make two-way bindings to inputs', () {
+ document.body.nodes.add(new Element.html('''
+ <template id="test" bind>
+ <input id="input" value="{{ firstName }}">
+ </template>'''));
var person = new Person('John', 'Messerly', ['A', 'B', 'C']);
query('#test')
..bindingDelegate = new PolymerExpressions()
@@ -44,6 +41,20 @@ main() {
});
});
+ test('should handle null collections in "in" expressions', () {
+ document.body.nodes.add(new Element.html('''
+ <template id="test" bind>
+ <template repeat="{{ item in items }}">
+ {{ item }}
+ </template>
+ </template>'''));
+ query('#test')
+ ..bindingDelegate = new PolymerExpressions(globals: {'items': null})
+ ..model = null;
+ // the template should be the only node
+ expect(document.body.nodes.length, 1);
+ expect(document.body.nodes[0].id, 'test');
+ });
});
}
« pkg/polymer_expressions/lib/eval.dart ('K') | « pkg/polymer_expressions/test/eval_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698