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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 form = fixture('FormGet'); | 303 form = fixture('FormGet'); |
304 | 304 |
305 var submitted = false; | 305 var submitted = false; |
306 form.addEventListener('iron-form-submit', function() { | 306 form.addEventListener('iron-form-submit', function() { |
307 submitted = true; | 307 submitted = true; |
308 }); | 308 }); |
309 | 309 |
310 form.addEventListener('iron-form-response', function(event) { | 310 form.addEventListener('iron-form-response', function(event) { |
311 expect(submitted).to.be.equal(true); | 311 expect(submitted).to.be.equal(true); |
312 | 312 |
313 var response = event.detail; | 313 var response = event.detail.response; |
314 expect(response).to.be.ok; | 314 expect(response).to.be.ok; |
315 expect(response).to.be.an('object'); | 315 expect(response).to.be.an('object'); |
316 expect(response.success).to.be.equal(true); | 316 expect(response.success).to.be.equal(true); |
317 done(); | 317 done(); |
318 }); | 318 }); |
319 | 319 |
320 form.submit(); | 320 form.submit(); |
321 server.respond(); | 321 server.respond(); |
322 }); | 322 }); |
323 | 323 |
324 test('can submit with method=post', function(done) { | 324 test('can submit with method=post', function(done) { |
325 form = fixture('FormPost'); | 325 form = fixture('FormPost'); |
326 | 326 |
327 var submitted = false; | 327 var submitted = false; |
328 form.addEventListener('iron-form-submit', function() { | 328 form.addEventListener('iron-form-submit', function() { |
329 submitted = true; | 329 submitted = true; |
330 }); | 330 }); |
331 | 331 |
332 form.addEventListener('iron-form-response', function(event) { | 332 form.addEventListener('iron-form-response', function(event) { |
333 expect(submitted).to.be.equal(true); | 333 expect(submitted).to.be.equal(true); |
334 var response = event.detail; | 334 var response = event.detail.response; |
335 expect(response).to.be.ok; | 335 expect(response).to.be.ok; |
336 expect(response).to.be.an('object'); | 336 expect(response).to.be.an('object'); |
337 expect(response.success).to.be.equal(true); | 337 expect(response.success).to.be.equal(true); |
338 done(); | 338 done(); |
339 }); | 339 }); |
340 | 340 |
341 form.submit(); | 341 form.submit(); |
342 server.respond(); | 342 server.respond(); |
343 }); | 343 }); |
344 | 344 |
(...skipping 13 matching lines...) Expand all Loading... |
358 form.submit(); | 358 form.submit(); |
359 server.respond(); | 359 server.respond(); |
360 }); | 360 }); |
361 | 361 |
362 }); | 362 }); |
363 | 363 |
364 </script> | 364 </script> |
365 | 365 |
366 </body> | 366 </body> |
367 </html> | 367 </html> |
OLD | NEW |