Chromium Code Reviews| 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'); |
| + }); |
| }); |
| } |