diff options
| author | Igor Minar | 2011-07-12 22:49:12 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-07-12 22:49:12 -0700 |
| commit | bb39d34279fe1e221d35f5d2a274aaf039ea62d4 (patch) | |
| tree | 520b2edf7b76a56034859bae762756af06f25838 /test/widgetsSpec.js | |
| parent | e09a78438f9c4a43aec6fefed9efd58a0b4060de (diff) | |
| download | angular.js-bb39d34279fe1e221d35f5d2a274aaf039ea62d4.tar.bz2 | |
test(ng:repeat): add tests for $position for small arrays/objects
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index aadc1597..0d8f90eb 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -900,6 +900,11 @@ describe("widget", function(){ scope.items.push('frodo'); scope.$eval(); expect(element.text()).toEqual('misko:first|shyam:middle|doug:middle|frodo:last|'); + + scope.items.pop(); + scope.items.pop(); + scope.$eval(); + expect(element.text()).toEqual('misko:first|shyam:last|'); }); it('should expose iterator position as $position when iterating over objects', function() { @@ -908,6 +913,11 @@ describe("widget", function(){ scope.items = {'misko':'m', 'shyam':'s', 'doug':'d', 'frodo':'f'}; scope.$eval(); expect(element.text()).toEqual('misko:m:first|shyam:s:middle|doug:d:middle|frodo:f:last|'); + + delete scope.items.doug; + delete scope.items.frodo; + scope.$eval(); + expect(element.text()).toEqual('misko:m:first|shyam:s:last|'); }); }); |
