diff options
| author | Igor Minar | 2011-09-15 05:36:00 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-09-16 02:44:33 +0200 |
| commit | 7ae536d0532b7ad7859f9cf7e47b406f63383f29 (patch) | |
| tree | ef2f6721945e1c72d508c97b6775244a5a38a5bc /test | |
| parent | 2170c06924b3a0dc1fef3b383d6a236e670dceea (diff) | |
| download | angular.js-7ae536d0532b7ad7859f9cf7e47b406f63383f29.tar.bz2 | |
fix(specs): various fixes to get IE8+jquery unit tests green
Diffstat (limited to 'test')
| -rw-r--r-- | test/AngularSpec.js | 2 | ||||
| -rw-r--r-- | test/CompilerSpec.js | 2 | ||||
| -rw-r--r-- | test/jqLiteSpec.js | 21 | ||||
| -rw-r--r-- | test/markupSpec.js | 6 |
4 files changed, 24 insertions, 7 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 4e4cd74a..9f77d3ea 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -597,7 +597,7 @@ describe('angular', function(){ describe('nodeName_', function() { it('should correctly detect node name with "namespace" when xmlns is defined', function() { var div = jqLite('<div xmlns:ngtest="http://angularjs.org/">' + - '<ngtest:foo ngtest:attr="bar"></ng:test>' + + '<ngtest:foo ngtest:attr="bar"></ngtest:foo>' + '</div>')[0]; expect(nodeName_(div.childNodes[0])).toBe('NGTEST:FOO'); expect(div.childNodes[0].getAttribute('ngtest:attr')).toBe('bar'); diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index 8f86e99a..f0045aa8 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -74,7 +74,7 @@ describe('compiler', function(){ it('should observe scope', function(){ - scope = compile('<span observe="name">'); + scope = compile('<span observe="name"></span>'); expect(log).toEqual(""); scope.$digest(); scope.name = 'misko'; diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 63ba24bf..f9102754 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -339,15 +339,26 @@ describe('jqLite', function(){ expect(jqLite(b).css('margin')).toEqual('3px'); selector.css('margin', ''); - expect(jqLite(a).css('margin')).toBeFalsy(); - expect(jqLite(b).css('margin')).toBeFalsy(); + if (msie <= 8) { + expect(jqLite(a).css('margin')).toBe('auto'); + expect(jqLite(b).css('margin')).toBe('auto'); + } else { + expect(jqLite(a).css('margin')).toBeFalsy(); + expect(jqLite(b).css('margin')).toBeFalsy(); + } }); it('should set a bunch of css properties specified via an object', function() { - expect(jqLite(a).css('margin')).toBeFalsy(); - expect(jqLite(a).css('padding')).toBeFalsy(); - expect(jqLite(a).css('border')).toBeFalsy(); + if (msie <= 8) { + expect(jqLite(a).css('margin')).toBe('auto'); + expect(jqLite(a).css('padding')).toBe('0px'); + expect(jqLite(a).css('border')).toBeUndefined(); + } else { + expect(jqLite(a).css('margin')).toBeFalsy(); + expect(jqLite(a).css('padding')).toBeFalsy(); + expect(jqLite(a).css('border')).toBeFalsy(); + } jqLite(a).css({'margin': '1px', 'padding': '2px', 'border': ''}); diff --git a/test/markupSpec.js b/test/markupSpec.js index 6874cdcd..2704e0dc 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -63,6 +63,11 @@ describe("markups", function(){ }); }); + afterEach(function() { + if (element) element.remove(); + }); + + it('should populate value attribute on OPTION', function(){ compile('<select name="x"><option>abc</option></select>'); expect(element).toHaveValue('abc'); @@ -114,6 +119,7 @@ describe("markups", function(){ it('should bind selected', function() { compile('<select><option value=""></option><option ng:selected="{{isSelected}}">Greetings!</option></select>'); + jqLite(document.body).append(element) scope.isSelected=false; scope.$digest(); expect(element.children()[1].selected).toBeFalsy(); |
