OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <!-- | 2 <!-- |
3 @license | 3 @license |
4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
8 Code distributed by Google as part of the polymer project is also | 8 Code distributed by Google as part of the polymer project is also |
9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
10 --> | 10 --> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 test('clicking the selected item should not deselect', function (done) { | 147 test('clicking the selected item should not deselect', function (done) { |
148 var g = fixture('WithSelection'); | 148 var g = fixture('WithSelection'); |
149 var items = g.items; | 149 var items = g.items; |
150 | 150 |
151 expect(items[0].checked).to.be.equal(true); | 151 expect(items[0].checked).to.be.equal(true); |
152 MockInteractions.tap(items[0]); | 152 MockInteractions.tap(items[0]); |
153 | 153 |
154 // The selection should not change, but wait for a little bit just | 154 // The selection should not change, but wait for a little bit just |
155 // in case it would and an event would be fired. | 155 // in case it would and an event would be fired. |
156 setTimeout(function() { | 156 setTimeout(function() { |
157 try { | 157 expect(items[0].checked).to.be.equal(true); |
158 expect(items[0].checked).to.be.equal(true); | 158 expect(items[1].checked).to.be.equal(false); |
159 expect(items[1].checked).to.be.equal(false); | 159 expect(items[2].checked).to.be.equal(false); |
160 expect(items[2].checked).to.be.equal(false); | 160 done(); |
161 done(); | 161 }, 1); |
162 } catch (e) { | 162 }); |
163 done(e) | 163 |
164 } | 164 test('clicking the selected item should deselect if allow-empty-selectio
n is set', function (done) { |
165 }, 200); | 165 var g = fixture('WithSelection'); |
| 166 g.allowEmptySelection = true; |
| 167 var items = g.items; |
| 168 |
| 169 expect(items[0].checked).to.be.equal(true); |
| 170 MockInteractions.tap(items[0]); |
| 171 |
| 172 // The selection should not change, but wait for a little bit just |
| 173 // in case it would and an event would be fired. |
| 174 setTimeout(function() { |
| 175 expect(items[0].checked).to.be.equal(false); |
| 176 expect(items[1].checked).to.be.equal(false); |
| 177 expect(items[2].checked).to.be.equal(false); |
| 178 done(); |
| 179 }, 1); |
166 }); | 180 }); |
167 | 181 |
168 }); | 182 }); |
169 </script> | 183 </script> |
170 </body> | 184 </body> |
171 </html> | 185 </html> |
OLD | NEW |