|
71 | 71 | </test-fixture> |
72 | 72 |
|
73 | 73 | <script> |
| 74 | + (function() { |
| 75 | + // The maximum number of milliseconds after completing a track action that |
| 76 | + // may occur before the 'iron-swipe' event is dispatched, if any would be. |
| 77 | + // This value should be longer than the swipe transition. |
| 78 | + const SWIPE_TIMEOUT = 500; |
| 79 | + |
74 | 80 | suite('native elements', function() { |
75 | 81 | test('dragging less than halfway does not swipe', function(done) { |
76 | 82 | var container = fixture('basic'); |
|
89 | 95 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
90 | 96 | .to.be.equal(2); |
91 | 97 | done(); |
92 | | - }, 1); |
93 | | - }); |
| 98 | + }, SWIPE_TIMEOUT); |
| 99 | + }, 1); |
94 | 100 | }); |
95 | 101 |
|
96 | 102 | test('dragging more than halfway swipes it', function(done) { |
|
108 | 114 | }); |
109 | 115 |
|
110 | 116 | MockInteractions.track(element, 60, 0); |
111 | | - }); |
| 117 | + }, 1); |
112 | 118 | }); |
113 | 119 |
|
114 | 120 | test('an element with disable-swipe cannot be swiped', function(done) { |
|
129 | 135 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
130 | 136 | .to.be.equal(2); |
131 | 137 | done(); |
132 | | - }, 1); |
133 | | - }); |
| 138 | + }, SWIPE_TIMEOUT); |
| 139 | + }, 1); |
134 | 140 | }); |
135 | 141 | }); |
136 | 142 |
|
|
152 | 158 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
153 | 159 | .to.be.equal(2); |
154 | 160 | done(); |
155 | | - }, 1); |
156 | | - }); |
| 161 | + }, SWIPE_TIMEOUT); |
| 162 | + }, 1); |
157 | 163 | }); |
158 | 164 |
|
159 | 165 | test('dragging more than halfway swipes it', function(done) { |
|
171 | 177 | }); |
172 | 178 |
|
173 | 179 | MockInteractions.track(element, 60, 0); |
174 | | - }); |
| 180 | + }, 1); |
175 | 181 | }); |
176 | 182 |
|
177 | 183 | test('an element with disable-swipe cannot be swiped', function(done) { |
|
192 | 198 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
193 | 199 | .to.be.equal(2); |
194 | 200 | done(); |
195 | | - }, 1); |
196 | | - }); |
| 201 | + }, SWIPE_TIMEOUT); |
| 202 | + }, 1); |
197 | 203 | }); |
198 | 204 | }); |
199 | 205 |
|
|
217 | 223 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
218 | 224 | .to.be.equal(2); |
219 | 225 | done(); |
220 | | - }, 1); |
221 | | - }); |
| 226 | + }, SWIPE_TIMEOUT); |
| 227 | + }, 1); |
222 | 228 | }); |
223 | 229 |
|
224 | 230 | test( |
|
240 | 246 | expect(Polymer.dom(container).queryDistributedElements('*').length) |
241 | 247 | .to.be.equal(2); |
242 | 248 | done(); |
243 | | - }, 1); |
244 | | - }); |
| 249 | + }, SWIPE_TIMEOUT); |
| 250 | + }, 1); |
245 | 251 | }); |
246 | 252 | }); |
247 | 253 |
|
|
268 | 274 | }); |
269 | 275 |
|
270 | 276 | MockInteractions.track(element, 60, 0); |
271 | | - }); |
| 277 | + }, 1); |
272 | 278 | }); |
273 | 279 | }); |
| 280 | + })(); |
274 | 281 | </script> |
275 | 282 | </body> |
276 | 283 | </html> |
0 commit comments