diff options
| author | Misko Hevery | 2010-03-25 14:51:42 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-03-25 14:51:42 -0700 |
| commit | 0cc9b0732003451537a5bfc444fb6590f4ed103a (patch) | |
| tree | 214e0b16d1b4f7b85f803aa5e5eedc4933e6e298 /test/widgetsSpec.js | |
| parent | 4fa166866b97d4f4dbd21514dbd674347da0a109 (diff) | |
| download | angular.js-0cc9b0732003451537a5bfc444fb6590f4ed103a.tar.bz2 | |
input select-multiple now works
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 9471a718..0f416278 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -148,14 +148,12 @@ describe("input widget", function(){ expect(model.clicked).toEqual(1); }); - it('should type="radio"', function(){ + it('should type="select-one"', function(){ compile( '<select name="selection">' + '<option>A</option>' + '<option selected>B</option>' + '</select>'); - expect(element[0].selectedIndex).toEqual(1); - expect(element[0].value).toEqual('B'); expect(model.selection).toEqual('B'); model.selection = 'A'; model.$updateView(); @@ -163,6 +161,18 @@ describe("input widget", function(){ expect(element[0].childNodes[0].selected).toEqual(true); }); + it('should type="select-multiple"', function(){ + compile( + '<select name="selection" multiple>' + + '<option>A</option>' + + '<option selected>B</option>' + + '</select>'); + expect(model.selection).toEqual(['B']); + model.selection = ['A']; + model.$updateView(); + expect(element[0].childNodes[0].selected).toEqual(true); + }); + it('should report error on missing field', function(){ }); |
