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

Commit

Permalink
test($rootScope): ensure that only child scopes are disconnected
Browse files Browse the repository at this point in the history
Related to #11786 and 8fe781f
  • Loading branch information
petebacondarwin committed Oct 28, 2015
1 parent 2a5a52a commit 1c0f721
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/ng/rootScopeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,15 +1219,17 @@ describe('Scope', function() {
var parent = $rootScope.$new(),
child1 = parent.$new(),
child2 = parent.$new(),
grandChild = child1.$new();
parent.$destroy();
grandChild1 = child1.$new(),
grandChild2 = child1.$new();

child1.$destroy();
$rootScope.$digest();

expect(isDisconnected(parent)).toBe(true);
expect(isDisconnected(parent)).toBe(false);
expect(isDisconnected(child1)).toBe(true);
expect(isDisconnected(child2)).toBe(true);
expect(isDisconnected(grandChild)).toBe(true);
expect(isDisconnected(child2)).toBe(false);
expect(isDisconnected(grandChild1)).toBe(true);
expect(isDisconnected(grandChild2)).toBe(true);

function isDisconnected($scope) {
return $scope.$$nextSibling === null &&
Expand Down

0 comments on commit 1c0f721

Please sign in to comment.