| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library node_bindings_test; | 5 library node_bindings_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:mdv_observe/mdv_observe.dart'; | 9 import 'package:mdv/mdv.dart' as mdv; |
| 10 import 'package:observe/observe.dart'; |
| 10 import 'package:unittest/html_config.dart'; | 11 import 'package:unittest/html_config.dart'; |
| 11 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
| 12 import 'mdv_observe_utils.dart'; | 13 import 'observe_utils.dart'; |
| 13 | 14 |
| 14 // Note: this file ported from | 15 // Note: this file ported from |
| 15 // https://github.com/toolkitchen/mdv/blob/master/tests/element_bindings.js | 16 // https://github.com/toolkitchen/mdv/blob/master/tests/element_bindings.js |
| 16 | 17 |
| 17 main() { | 18 main() { |
| 19 mdv.initialize(); |
| 18 useHtmlConfiguration(); | 20 useHtmlConfiguration(); |
| 19 group('Element Bindings', elementBindingTests); | 21 group('Element Bindings', elementBindingTests); |
| 20 } | 22 } |
| 21 | 23 |
| 22 sym(x) => new Symbol(x); | 24 sym(x) => new Symbol(x); |
| 23 | 25 |
| 24 observePath(obj, path) => new PathObserver(obj, path); | 26 observePath(obj, path) => new PathObserver(obj, path); |
| 25 | 27 |
| 26 elementBindingTests() { | 28 elementBindingTests() { |
| 27 var testDiv; | 29 var testDiv; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 337 |
| 336 var model = toSymbolMap({'foo': 'bar'}); | 338 var model = toSymbolMap({'foo': 'bar'}); |
| 337 el.attributes['foo'] = '{{foo}} {{foo}}'; | 339 el.attributes['foo'] = '{{foo}} {{foo}}'; |
| 338 template.model = model; | 340 template.model = model; |
| 339 | 341 |
| 340 deliverChangeRecords(); | 342 deliverChangeRecords(); |
| 341 el = testDiv.nodes[1]; | 343 el = testDiv.nodes[1]; |
| 342 expect(el.attributes['foo'], 'bar bar'); | 344 expect(el.attributes['foo'], 'bar bar'); |
| 343 }); | 345 }); |
| 344 } | 346 } |
| OLD | NEW |