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

Commit 1c0f721

Browse files
test($rootScope): ensure that only child scopes are disconnected
Related to #11786 and 8fe781f
1 parent 2a5a52a commit 1c0f721

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/ng/rootScopeSpec.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1219,15 +1219,17 @@ describe('Scope', function() {
12191219
var parent = $rootScope.$new(),
12201220
child1 = parent.$new(),
12211221
child2 = parent.$new(),
1222-
grandChild = child1.$new();
1223-
parent.$destroy();
1222+
grandChild1 = child1.$new(),
1223+
grandChild2 = child1.$new();
12241224

1225+
child1.$destroy();
12251226
$rootScope.$digest();
12261227

1227-
expect(isDisconnected(parent)).toBe(true);
1228+
expect(isDisconnected(parent)).toBe(false);
12281229
expect(isDisconnected(child1)).toBe(true);
1229-
expect(isDisconnected(child2)).toBe(true);
1230-
expect(isDisconnected(grandChild)).toBe(true);
1230+
expect(isDisconnected(child2)).toBe(false);
1231+
expect(isDisconnected(grandChild1)).toBe(true);
1232+
expect(isDisconnected(grandChild2)).toBe(true);
12311233

12321234
function isDisconnected($scope) {
12331235
return $scope.$$nextSibling === null &&

0 commit comments

Comments
 (0)