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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 test('removing rows shrinks the textarea', function() { | 81 test('removing rows shrinks the textarea', function() { |
82 var autogrow = fixture('basic'); | 82 var autogrow = fixture('basic'); |
83 autogrow.bindValue = 'batman\nand\nrobin'; | 83 autogrow.bindValue = 'batman\nand\nrobin'; |
84 var initialHeight = autogrow.offsetHeight; | 84 var initialHeight = autogrow.offsetHeight; |
85 | 85 |
86 autogrow.bindValue = 'batman'; | 86 autogrow.bindValue = 'batman'; |
87 var finalHeight = autogrow.offsetHeight | 87 var finalHeight = autogrow.offsetHeight |
88 assert.isTrue(finalHeight < initialHeight); | 88 assert.isTrue(finalHeight < initialHeight); |
89 }); | 89 }); |
90 | 90 |
| 91 test('an undefined bindValue is the empty string', function() { |
| 92 var autogrow = fixture('basic'); |
| 93 var initialHeight = autogrow.offsetHeight; |
| 94 |
| 95 autogrow.bindValue = 'batman\nand\nrobin'; |
| 96 var finalHeight = autogrow.offsetHeight; |
| 97 assert.isTrue(finalHeight > initialHeight); |
| 98 |
| 99 autogrow.bindValue = undefined; |
| 100 assert.equal(autogrow.offsetHeight, initialHeight); |
| 101 assert.equal(autogrow.textarea.value, ''); |
| 102 }); |
| 103 |
91 test('textarea selection works', function() { | 104 test('textarea selection works', function() { |
92 var autogrow = fixture('basic'); | 105 var autogrow = fixture('basic'); |
93 var textarea = autogrow.textarea; | 106 var textarea = autogrow.textarea; |
94 autogrow.bindValue = 'batman\nand\nrobin'; | 107 autogrow.bindValue = 'batman\nand\nrobin'; |
95 | 108 |
96 autogrow.selectionStart = 3; | 109 autogrow.selectionStart = 3; |
97 autogrow.selectionEnd = 5; | 110 autogrow.selectionEnd = 5; |
98 | 111 |
99 assert.equal(textarea.selectionStart, 3); | 112 assert.equal(textarea.selectionStart, 3); |
100 assert.equal(textarea.selectionEnd, 5); | 113 assert.equal(textarea.selectionEnd, 5); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 153 |
141 input.bindValue = 'batman'; | 154 input.bindValue = 'batman'; |
142 assert.isTrue(input.validate()); | 155 assert.isTrue(input.validate()); |
143 }); | 156 }); |
144 }); | 157 }); |
145 | 158 |
146 </script> | 159 </script> |
147 | 160 |
148 </body> | 161 </body> |
149 </html> | 162 </html> |
OLD | NEW |