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

Commit 3c2089a

Browse files
committed
fix tests
1 parent e1b9f59 commit 3c2089a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

test/BinderSpec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,15 @@ describe('Binder', function() {
401401
expect(optionC.text()).toEqual('C');
402402
}));
403403

404-
it('ItShouldSelectTheCorrectRadioBox', inject(function($rootScope, $compile) {
404+
it('ItShouldSelectTheCorrectRadioBox', inject(function($rootScope, $compile, $rootElement, $document) {
405405
element = $compile(
406406
'<div>' +
407407
'<input type="radio" ng-model="sex" value="female">' +
408408
'<input type="radio" ng-model="sex" value="male">' +
409409
'</div>')($rootScope);
410+
411+
jqLite($document[0].body).append($rootElement.append(element));
412+
410413
var female = jqLite(element[0].childNodes[0]);
411414
var male = jqLite(element[0].childNodes[1]);
412415

test/ng/directive/booleanAttrsSpec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ describe('boolean attr directives', function() {
4242
}));
4343

4444

45-
it('should not bind checked when ngModel is present', inject(function($rootScope, $compile) {
45+
it('should not bind checked when ngModel is present', inject(function($rootScope, $compile, $document, $rootElement) {
4646
// test for https://github.com/angular/angular.js/issues/10662
4747
element = $compile('<input type="checkbox" ng-model="value" ng-false-value="\'false\'" ' +
4848
'ng-true-value="\'true\'" ng-checked="value" />')($rootScope);
49+
50+
jqLite($document[0].body).append($rootElement.append(element));
51+
4952
$rootScope.value = 'true';
5053
$rootScope.$digest();
5154
expect(element[0].checked).toBe(true);

test/ng/directive/ngRepeatSpec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ describe('ngRepeat', function() {
354354
});
355355

356356

357-
it('should iterate over object with changing primitive property values', function() {
357+
it('should iterate over object with changing primitive property values', inject(function($rootElement, $document) {
358358
// test for issue #933
359359

360360
element = $compile(
@@ -365,6 +365,8 @@ describe('ngRepeat', function() {
365365
'</li>' +
366366
'</ul>')(scope);
367367

368+
jqLite($document[0].body).append($rootElement.append(element));
369+
368370
scope.items = {misko: true, shyam: true, zhenbo:true};
369371
scope.$digest();
370372
expect(element.find('li').length).toEqual(3);
@@ -395,7 +397,7 @@ describe('ngRepeat', function() {
395397
expect(element.find('input')[0].checked).toBe(false);
396398
expect(element.find('input')[1].checked).toBe(true);
397399
expect(element.find('input')[2].checked).toBe(true);
398-
});
400+
}));
399401
});
400402

401403
describe('alias as', function() {

0 commit comments

Comments
 (0)