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 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
7 import 'package:unittest/html_config.dart'; | 7 import 'package:unittest/html_config.dart'; |
8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
9 | 9 |
10 @CustomTag('x-foo') | 10 @CustomTag('x-foo') |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 @observable var values = {}; | 49 @observable var values = {}; |
50 } | 50 } |
51 | 51 |
52 main() { | 52 main() { |
53 initPolymer(); | 53 initPolymer(); |
54 useHtmlConfiguration(); | 54 useHtmlConfiguration(); |
55 | 55 |
56 setUp(() => Polymer.onReady); | 56 setUp(() => Polymer.onReady); |
57 | 57 |
58 test('take attributes', () { | 58 test('take attributes', () { |
59 queryXTag(x) => document.query(x); | 59 queryXTag(x) => document.querySelector(x); |
60 | 60 |
61 expect(queryXTag("#foo0").boolean, true); | 61 expect(queryXTag("#foo0").boolean, true); |
62 expect(queryXTag("#foo1").boolean, false); | 62 expect(queryXTag("#foo1").boolean, false); |
63 expect(queryXTag("#foo2").boolean, true); | 63 expect(queryXTag("#foo2").boolean, true); |
64 expect(queryXTag("#foo3").boolean, false); | 64 expect(queryXTag("#foo3").boolean, false); |
65 // this one is only 'truthy' | 65 // this one is only 'truthy' |
66 expect(queryXTag("#foo4").boolean, true); | 66 expect(queryXTag("#foo4").boolean, true); |
67 // this one is also 'truthy', but should it be? | 67 // this one is also 'truthy', but should it be? |
68 expect(queryXTag("#foo5").boolean, true); | 68 expect(queryXTag("#foo5").boolean, true); |
69 // | 69 // |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 expect(queryXTag("#arr1").values, [0, 1, 2]); | 113 expect(queryXTag("#arr1").values, [0, 1, 2]); |
114 expect(queryXTag("#arr2").values, [33]); | 114 expect(queryXTag("#arr2").values, [33]); |
115 // Object deserialization tests | 115 // Object deserialization tests |
116 expect(queryXTag("#obj1").values, { 'name': 'Brandon', | 116 expect(queryXTag("#obj1").values, { 'name': 'Brandon', |
117 'nums': [1, 22, 33] }); | 117 'nums': [1, 22, 33] }); |
118 expect(queryXTag("#obj2").values, { "color": "Red" }); | 118 expect(queryXTag("#obj2").values, { "color": "Red" }); |
119 expect(queryXTag("#obj3").values, { 'movie': 'Buckaroo Banzai', | 119 expect(queryXTag("#obj3").values, { 'movie': 'Buckaroo Banzai', |
120 'DOB': '07/31/1978' }); | 120 'DOB': '07/31/1978' }); |
121 }); | 121 }); |
122 } | 122 } |
OLD | NEW |