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

Commit 8fe4295

Browse files
committed
refactor(ngInclude): correct the tests
1 parent dcb8e07 commit 8fe4295

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/ng/directive/ngIncludeSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,22 @@ describe('ng-include', function() {
104104
$rootScope.url = 'url1';
105105
$rootScope.$digest();
106106
$httpBackend.flush();
107-
expect(element.children().scope()).toBeTruthy();
107+
expect(element.children().scope().$parent).toBe($rootScope);
108108
expect(element.text()).toBe('partial url1');
109109

110110
$rootScope.url = 'url2';
111111
$rootScope.$digest();
112112
$httpBackend.flush();
113-
expect(element.children().scope()).toBeFalsy();
113+
expect($rootScope.$$childHead).toBeFalsy();
114114
expect(element.text()).toBe('');
115115

116116
$rootScope.url = 'url1';
117117
$rootScope.$digest();
118-
expect(element.children().scope()).toBeTruthy();
118+
expect(element.children().scope().$parent).toBe($rootScope);
119119

120120
$rootScope.url = null;
121121
$rootScope.$digest();
122-
expect(element.children().scope()).toBeFalsy();
122+
expect($rootScope.$$childHead).toBeFalsy();
123123
}));
124124

125125

0 commit comments

Comments
 (0)