OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // attach iron-activate listener | 123 // attach iron-activate listener |
124 s.addEventListener("iron-activate", function(event) { | 124 s.addEventListener("iron-activate", function(event) { |
125 event.preventDefault(); | 125 event.preventDefault(); |
126 }); | 126 }); |
127 // select Item 2 | 127 // select Item 2 |
128 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true})); | 128 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true})); |
129 // shouldn't got selected since we preventDefault in iron-activate | 129 // shouldn't got selected since we preventDefault in iron-activate |
130 assert.equal(s.selected, '0'); | 130 assert.equal(s.selected, '0'); |
131 }); | 131 }); |
132 | 132 |
| 133 test('activates after detach and re-attach', function() { |
| 134 // Detach and re-attach |
| 135 var parent = s.parentNode; |
| 136 parent.removeChild(s); |
| 137 parent.appendChild(s); |
| 138 |
| 139 // select Item 2 |
| 140 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true})); |
| 141 assert.equal(s.selected, '2'); |
| 142 }); |
| 143 |
133 }); | 144 }); |
134 | 145 |
135 </script> | 146 </script> |
136 | 147 |
137 </body> | 148 </body> |
138 </html> | 149 </html> |
OLD | NEW |