diff options
| author | Eric Hagman | 2013-06-26 09:49:21 -0400 |
|---|---|---|
| committer | Brian Ford | 2013-08-12 12:00:47 -0700 |
| commit | 01cd34957e778a2fa8d26e2805c2dd5a7f986465 (patch) | |
| tree | 1b2c636ca694fd8571cffb462438558aebf1051c /test | |
| parent | 864517e5a273348c81cd1504e5a7af4359a38ec7 (diff) | |
| download | angular.js-01cd34957e778a2fa8d26e2805c2dd5a7f986465.tar.bz2 | |
fix(jqLite): return array from multi select in val()
Diffstat (limited to 'test')
| -rw-r--r-- | test/jqLiteSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 5b9a122c..ad7960b2 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -661,6 +661,26 @@ describe('jqLite', function() { expect(input[0].value).toEqual('abc'); expect(input.val()).toEqual('abc'); }); + + it('should get an array of selected elements from a multi select', function () { + expect(jqLite( + '<select multiple>' + + '<option selected>test 1</option>' + + '<option selected>test 2</option>' + + '</select>').val()).toEqual(['test 1', 'test 2']); + + expect(jqLite( + '<select multiple>' + + '<option selected>test 1</option>' + + '<option>test 2</option>' + + '</select>').val()).toEqual(['test 1']); + + expect(jqLite( + '<select multiple>' + + '<option>test 1</option>' + + '<option>test 2</option>' + + '</select>').val()).toEqual(null); + }); }); |
