Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit bb39d34

Browse files
committed
test(ng:repeat): add tests for $position for small arrays/objects
1 parent e09a784 commit bb39d34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/widgetsSpec.js

+10
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,11 @@ describe("widget", function(){
900900
scope.items.push('frodo');
901901
scope.$eval();
902902
expect(element.text()).toEqual('misko:first|shyam:middle|doug:middle|frodo:last|');
903+
904+
scope.items.pop();
905+
scope.items.pop();
906+
scope.$eval();
907+
expect(element.text()).toEqual('misko:first|shyam:last|');
903908
});
904909

905910
it('should expose iterator position as $position when iterating over objects', function() {
@@ -908,6 +913,11 @@ describe("widget", function(){
908913
scope.items = {'misko':'m', 'shyam':'s', 'doug':'d', 'frodo':'f'};
909914
scope.$eval();
910915
expect(element.text()).toEqual('misko:m:first|shyam:s:middle|doug:d:middle|frodo:f:last|');
916+
917+
delete scope.items.doug;
918+
delete scope.items.frodo;
919+
scope.$eval();
920+
expect(element.text()).toEqual('misko:m:first|shyam:s:last|');
911921
});
912922
});
913923

0 commit comments

Comments
 (0)