|
17 | 17 | </head>
|
18 | 18 | <body>
|
19 | 19 |
|
| 20 | + <x-basic></x-basic> |
| 21 | + <polymer-element name="x-basic" attributes="nog" noscript> |
| 22 | + </polymer-element> |
| 23 | + |
| 24 | + <x-attr-publish></x-attr-publish> |
| 25 | + <polymer-element name="x-attr-publish" attributes="nog"> |
| 26 | + <script> |
| 27 | + Polymer('x-attr-publish', { |
| 28 | + publish: { |
| 29 | + nog: {value: '', reflect: false} |
| 30 | + } |
| 31 | + }); |
| 32 | + </script> |
| 33 | + </polymer-element> |
| 34 | + |
20 | 35 | <x-foo></x-foo>
|
21 | 36 | <polymer-element name="x-foo">
|
22 | 37 | <script>
|
|
80 | 95 | }
|
81 | 96 |
|
82 | 97 | document.addEventListener('polymer-ready', function() {
|
| 98 | + var xbasic = document.querySelector('x-basic'); |
| 99 | + assert.equal(xbasic.nog, undefined, 'property published with `attributes` has correct initial value'); |
| 100 | + xbasic.setAttribute('nog', 'hi'); |
| 101 | + assert.equal(xbasic.nog, 'hi', 'deserialization of property published via `attributes`'); |
| 102 | + |
| 103 | + var xattrpublish = document.querySelector('x-attr-publish'); |
| 104 | + assert.equal(xattrpublish.nog, '', 'property published with `attributes` has correct initial value'); |
| 105 | + xattrpublish.setAttribute('nog', 'hi'); |
| 106 | + assert.equal(xattrpublish.nog, 'hi', 'deserialization of property published via `attributes`'); |
| 107 | + |
83 | 108 | var xcompose = document.querySelector('x-compose');
|
84 | 109 | var xfoo = document.querySelector('x-foo');
|
| 110 | + assert.equal(xfoo.foo, '', 'property published with info object has correct initial value'); |
85 | 111 | xfoo.foo = 5;
|
86 | 112 | xfoo.setAttribute('def1', '15');
|
87 | 113 | xfoo.def2 = 15;
|
|
98 | 124 | assert.equal(xfoo.baz, xfoo.getAttribute('baz'), 'attribute reflects property');
|
99 | 125 | //
|
100 | 126 | var xbar = document.querySelector('x-bar');
|
| 127 | + assert.equal(xbar.zim, false, 'property published with info object has correct initial value'); |
| 128 | + assert.equal(xbar.foo, '', 'property published with info object has correct initial value'); |
101 | 129 | //
|
102 | 130 | xbar.foo = 'foo!';
|
103 | 131 | xbar.zot = 27;
|
|
0 commit comments