From 7ae536d0532b7ad7859f9cf7e47b406f63383f29 Mon Sep 17 00:00:00 2001
From: Igor Minar
Date: Thu, 15 Sep 2011 05:36:00 +0200
Subject: fix(specs): various fixes to get IE8+jquery unit tests green
---
test/AngularSpec.js | 2 +-
test/CompilerSpec.js | 2 +-
test/jqLiteSpec.js | 21 ++++++++++++++++-----
test/markupSpec.js | 6 ++++++
4 files changed, 24 insertions(+), 7 deletions(-)
(limited to 'test')
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('
' +
- '' +
+ '' +
'
')[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('');
+ scope = compile('');
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('');
expect(element).toHaveValue('abc');
@@ -114,6 +119,7 @@ describe("markups", function(){
it('should bind selected', function() {
compile('');
+ jqLite(document.body).append(element)
scope.isSelected=false;
scope.$digest();
expect(element.children()[1].selected).toBeFalsy();
--
cgit v1.2.3