Skip to content

Commit

Permalink
chore(accordion): add missing test for $destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxandxss authored and jasonaden committed Sep 30, 2015
1 parent 60ae876 commit 77df1d5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/accordion/test/accordion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ describe('accordion', function() {
ctrl.removeGroup({});
expect(ctrl.groups.length).toBe(2);
});
it('should remove a panel when the scope is destroyed', function() {
var group1, group2, group3;
ctrl.addGroup(group1 = $scope.$new());
ctrl.addGroup(group2 = $scope.$new());
ctrl.addGroup(group3 = $scope.$new());
group2.$destroy();
expect(ctrl.groups.length).toBe(2);
expect(ctrl.groups[0]).toBe(group1);
expect(ctrl.groups[1]).toBe(group3);
});
});
});

Expand Down

0 comments on commit 77df1d5

Please sign in to comment.