diff options
| author | Misko Hevery | 2011-07-11 12:55:29 -0700 |
|---|---|---|
| committer | Misko Hevery | 2011-07-26 09:41:42 -0700 |
| commit | c348f2cad6e2db0c3a37108eb34c8d62f2b7c718 (patch) | |
| tree | 85aba2dbc5e801c9b6c09f663c141d62829b0b9c /test/widgetsSpec.js | |
| parent | f3456dc2826e9570cf2969fab3c314255d16188f (diff) | |
| download | angular.js-c348f2cad6e2db0c3a37108eb34c8d62f2b7c718.tar.bz2 | |
fix(directive): ng:options incorrectly re-grew options on datasource change
Closes #464
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 5d39b4ec..342dc8c5 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -672,6 +672,24 @@ describe("widget", function(){ expect(select.find('option').length).toEqual(1); // we add back the special empty option }); + it('should shrink and then grow list', function(){ + createSingleSelect(); + scope.values = [{name:'A'}, {name:'B'}, {name:'C'}]; + scope.selected = scope.values[0]; + scope.$eval(); + expect(select.find('option').length).toEqual(3); + + scope.values = [{name:'1'}, {name:'2'}]; + scope.selected = scope.values[0]; + scope.$eval(); + expect(select.find('option').length).toEqual(2); + + scope.values = [{name:'A'}, {name:'B'}, {name:'C'}]; + scope.selected = scope.values[0]; + scope.$eval(); + expect(select.find('option').length).toEqual(3); + }); + it('should update list', function(){ createSingleSelect(); scope.values = [{name:'A'}, {name:'B'}, {name:'C'}]; |
