| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 test('opened attribute', function() { | 49 test('opened attribute', function() { |
| 50 assert.equal(collapse.opened, true); | 50 assert.equal(collapse.opened, true); |
| 51 }); | 51 }); |
| 52 | 52 |
| 53 test('horizontal attribute', function() { | 53 test('horizontal attribute', function() { |
| 54 assert.equal(collapse.horizontal, true); | 54 assert.equal(collapse.horizontal, true); |
| 55 }); | 55 }); |
| 56 | 56 |
| 57 test('default opened width', function() { | 57 test('default opened width', function() { |
| 58 assert.equal(collapse.style.width, 'auto'); | 58 assert.equal(collapse.style.width, ''); |
| 59 }); | 59 }); |
| 60 | 60 |
| 61 test('set opened to false, then to true', function(done) { | 61 test('set opened to false, then to true', function(done) { |
| 62 // This listener will be triggered twice (every time `opened` changes)
. | 62 // This listener will be triggered twice (every time `opened` changes)
. |
| 63 collapse.addEventListener('transitionend', function() { | 63 collapse.addEventListener('transitionend', function() { |
| 64 if (collapse.opened) { | 64 if (collapse.opened) { |
| 65 // Check finalSize after animation is done. | 65 // Check finalSize after animation is done. |
| 66 assert.equal(collapse.style.width, 'auto'); | 66 assert.equal(collapse.style.width, ''); |
| 67 done(); | 67 done(); |
| 68 } else { | 68 } else { |
| 69 // Check if size is still 0px. | 69 // Check if size is still 0px. |
| 70 assert.equal(collapse.style.width, '0px'); | 70 assert.equal(collapse.style.maxWidth, '0px'); |
| 71 // Trigger 2nd toggle. | 71 // Trigger 2nd toggle. |
| 72 collapse.opened = true; | 72 collapse.opened = true; |
| 73 // Size should be immediately set. | 73 // Size should be immediately set. |
| 74 assert.equal(collapse.style.width, collapseWidth); | 74 assert.equal(collapse.style.maxWidth, collapseWidth); |
| 75 } | 75 } |
| 76 }); | 76 }); |
| 77 // Trigger 1st toggle. | 77 // Trigger 1st toggle. |
| 78 collapse.opened = false; | 78 collapse.opened = false; |
| 79 // Size should be immediately set. | 79 // Size should be immediately set. |
| 80 assert.equal(collapse.style.width, '0px'); | 80 assert.equal(collapse.style.maxWidth, '0px'); |
| 81 }); | 81 }); |
| 82 }); | 82 }); |
| 83 | 83 |
| 84 </script> | 84 </script> |
| 85 | 85 |
| 86 </body> | 86 </body> |
| 87 </html> | 87 </html> |
| OLD | NEW |