From 891ea06ded5d1653b124b07ce07c0f0dd5a7036b Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 31 May 2011 21:28:42 +0200 Subject: [PATCH] Fix unit test in IE7 --- src/angular-mocks.js | 4 +++- test/AngularSpec.js | 3 +-- test/testabilityPatch.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/angular-mocks.js b/src/angular-mocks.js index fc318064fcc3..f0313b25abca 100644 --- a/src/angular-mocks.js +++ b/src/angular-mocks.js @@ -203,7 +203,9 @@ MockBrowser.prototype = { } return this.cookieHash; } - } + }, + + addJs: function(){} }; angular.service('$browser', function(){ diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 444b9448d8a2..b58705cc67fb 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -454,9 +454,8 @@ describe('angular', function(){ return this.childNodes[1]; }; - angularInit({autobind: 'child'}, dom); - delete dom.getElementById; //make IE and sortedHtml happy + angularInit({autobind: 'child'}, dom); expect(sortedHtml(dom)).toEqual('
{{2+3}}' + '
'+ diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 0cc85a8cf776..5bcee3fef23a 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -215,7 +215,7 @@ function sortedHtml(element, showNgClass) { attr.name !='style' && attr.name.substr(0, 6) != 'jQuery') { // in IE we need to check for all of these. - if (!/ng-\d+/.exec(attr.name)) + if (!/ng-\d+/.exec(attr.name) && attr.name != 'getElementById') attrs.push(' ' + attr.name + '="' + attr.value + '"'); } }