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

Commit 512c031

Browse files
committed
fix tests
1 parent ee24a68 commit 512c031

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
@@ -352,7 +352,7 @@ describe('ngRepeat', function() {
352352
});
353353

354354

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

358358
element = $compile(
@@ -363,6 +363,8 @@ describe('ngRepeat', function() {
363363
'</li>' +
364364
'</ul>')(scope);
365365

366+
jqLite($document[0].body).append($rootElement.append(element));
367+
366368
scope.items = {misko: true, shyam: true, zhenbo:true};
367369
scope.$digest();
368370
expect(element.find('li').length).toEqual(3);
@@ -393,7 +395,7 @@ describe('ngRepeat', function() {
393395
expect(element.find('input')[0].checked).toBe(false);
394396
expect(element.find('input')[1].checked).toBe(true);
395397
expect(element.find('input')[2].checked).toBe(true);
396-
});
398+
}));
397399
});
398400

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

0 commit comments

Comments
 (0)