fix(forms): broken tests on jQuery and ie8&9

This commit is contained in:
Misko Hevery 2011-10-12 10:58:08 -07:00 committed by Igor Minar
parent 8611ebe6a0
commit 4af4378b11
2 changed files with 15 additions and 6 deletions

View file

@ -30,7 +30,7 @@ describe('form', function() {
it('should publish form to scope', function() {
doc = angular.element('<form name="myForm">');
doc = angular.element('<form name="myForm"></form>');
var scope = angular.compile(doc)();
expect(scope.myForm).toBeTruthy();
expect(doc.data('$form')).toBeTruthy();
@ -55,7 +55,12 @@ describe('form', function() {
it('should chain nested forms', function() {
doc = angular.element('<ng:form name=parent><ng:form name=child><input type=text ng:model=text name=text>');
doc = angular.element(
'<ng:form name=parent>' +
'<ng:form name=child>' +
'<input type=text ng:model=text name=text>' +
'</ng:form>' +
'</ng:form>');
var scope = angular.compile(doc)();
var parent = scope.parent;
var child = scope.child;
@ -72,8 +77,12 @@ describe('form', function() {
it('should chain nested forms in repeater', function() {
doc = angular.element('<ng:form name=parent>' +
'<ng:form ng:repeat="f in forms" name=child><input type=text ng:model=text name=text>');
doc = angular.element(
'<ng:form name=parent>' +
'<ng:form ng:repeat="f in forms" name=child>' +
'<input type=text ng:model=text name=text>' +
'</ng:form>' +
'</ng:form>');
var scope = angular.compile(doc)();
scope.forms = [1];
scope.$digest();

View file

@ -476,8 +476,8 @@ describe('select', function() {
scope.selected = [];
scope.$digest();
expect(select.find('option').length).toEqual(2);
expect(jqLite(select.find('option')[0]).attr('selected')).toBeFalsy();
expect(jqLite(select.find('option')[1]).attr('selected')).toBeFalsy();
expect(jqLite(select.find('option')[0]).prop('selected')).toBeFalsy();
expect(jqLite(select.find('option')[1]).prop('selected')).toBeFalsy();
scope.selected.push(scope.values[1]);
scope.$digest();