mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
refactor(ngInclude): correct the tests
This commit is contained in:
parent
dcb8e0767f
commit
8fe4295a06
1 changed files with 4 additions and 4 deletions
|
|
@ -104,22 +104,22 @@ describe('ng-include', function() {
|
|||
$rootScope.url = 'url1';
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
expect(element.children().scope()).toBeTruthy();
|
||||
expect(element.children().scope().$parent).toBe($rootScope);
|
||||
expect(element.text()).toBe('partial url1');
|
||||
|
||||
$rootScope.url = 'url2';
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
expect(element.children().scope()).toBeFalsy();
|
||||
expect($rootScope.$$childHead).toBeFalsy();
|
||||
expect(element.text()).toBe('');
|
||||
|
||||
$rootScope.url = 'url1';
|
||||
$rootScope.$digest();
|
||||
expect(element.children().scope()).toBeTruthy();
|
||||
expect(element.children().scope().$parent).toBe($rootScope);
|
||||
|
||||
$rootScope.url = null;
|
||||
$rootScope.$digest();
|
||||
expect(element.children().scope()).toBeFalsy();
|
||||
expect($rootScope.$$childHead).toBeFalsy();
|
||||
}));
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue