|
11 | 11 | <x-foo></x-foo> |
12 | 12 | <polymer-element name="x-foo" attributes="foo baz"> |
13 | 13 | <script> |
14 | | - Polymer('x-foo'); |
| 14 | + Polymer('x-foo', { |
| 15 | + foo: '', |
| 16 | + baz: '' |
| 17 | + }); |
15 | 18 | </script> |
16 | 19 | </polymer-element> |
17 | 20 |
|
|
69 | 72 | Platform.endOfMicrotask(function() { |
70 | 73 | assert.equal(xbar.foo, xbar.getAttribute('foo'), 'inherited published property is reflected'); |
71 | 74 | assert.equal(String(xbar.zot), xbar.getAttribute('zot'), 'attribute reflects property as number'); |
72 | | - assert.equal('', xbar.getAttribute('zim'), 'attribute reflects true valued boolean property as having attribute'); |
| 75 | + assert.equal(xbar.getAttribute('zim'), '', 'attribute reflects true valued boolean property as having attribute'); |
73 | 76 | assert.equal(xbar.str, xbar.getAttribute('str'), 'attribute reflects property as published string'); |
74 | 77 | assert.isFalse(xbar.hasAttribute('obj'), 'attribute does not reflect object property'); |
| 78 | + xbar.setAttribute('zim', 'false'); |
75 | 79 | xbar.setAttribute('foo', 'foo!!'); |
76 | 80 | xbar.setAttribute('zot', 54); |
77 | | - xbar.setAttribute('zim', 'false'); |
78 | 81 | xbar.setAttribute('str', 'str!!'); |
79 | 82 | xbar.setAttribute('obj', "{'hello': 'world'}"); |
80 | 83 | assert.equal(xbar.foo, xbar.getAttribute('foo'), 'property reflects attribute as string'); |
|
86 | 89 | Platform.flush(); |
87 | 90 | Platform.endOfMicrotask(function() { |
88 | 91 | assert.isFalse(xbar.hasAttribute('zim'), 'attribute reflects false valued boolean property as NOT having attribute'); |
89 | | - done(); |
| 92 | + var objAttr = xbar.getAttribute('obj'); |
| 93 | + xbar.obj = 'hi'; |
| 94 | + Platform.endOfMicrotask(function() { |
| 95 | + assert.equal(xbar.getAttribute('obj'), objAttr, 'do not reflect property with default type of object'); |
| 96 | + //assert.isFalse(xbar.hasAttribute('obj'), 'property with default type of object does not serialize'); |
| 97 | + done(); |
| 98 | + }); |
90 | 99 | }); |
91 | 100 | }); |
92 | 101 | }); |
|
0 commit comments