mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
refactor(ngInclude): correct the tests
This commit is contained in:
@@ -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();
|
||||
}));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user