From 22d93e0a3bc2a6dc0f64c63c68bc8f8489ea9068 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 20 Apr 2010 18:14:13 -0700 Subject: fixes to enable ie --- test/BinderTest.js | 14 +++++++------- test/CompilerSpec.js | 9 +++++---- test/directivesSpec.js | 2 +- test/widgetsSpec.js | 12 ++++++------ 4 files changed, 19 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/BinderTest.js b/test/BinderTest.js index 50e1683a..31b2698d 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -151,7 +151,7 @@ BinderTest.prototype.testInputTypeButtonActionExecutesInScope = function(){ c.scope.$set("person.save", function(){ savedCalled = true; }); - c.node.click(); + c.node.trigger('click'); assertTrue(savedCalled); }; @@ -162,7 +162,7 @@ BinderTest.prototype.testInputTypeButtonActionExecutesInScope2 = function(){ log += 'click;'; }); expect(log).toEqual(''); - c.node.click(); + c.node.trigger('click'); expect(log).toEqual('click;'); }; @@ -172,7 +172,7 @@ BinderTest.prototype.testButtonElementActionExecutesInScope = function(){ c.scope.$set("person.save", function(){ savedCalled = true; }); - c.node.click(); + c.node.trigger('click'); assertTrue(savedCalled); }; @@ -435,13 +435,13 @@ BinderTest.prototype.testActionOnAHrefThrowsError = function(){ throw {a:'abc', b:2}; }; var input = c.node; - input.click(); + input.trigger('click'); assertEquals({a:"abc", b:2}, fromJson(input.attr('ng-exception'))); assertTrue("should have an error class", input.hasClass('ng-exception')); // TODO: I think that exception should never get cleared so this portion of test makes no sense //c.scope.action = noop; - //input.click(); + //input.trigger('click'); //dump(input.attr('ng-error')); //assertFalse('error class should be cleared', input.hasClass('ng-exception')); }; @@ -574,10 +574,10 @@ BinderTest.prototype.testItShouldDisplayErrorWhenActionIsSyntacticlyIncorect = f var first = jqLite(c.node[0].childNodes[0]); var second = jqLite(c.node[0].childNodes[1]); - first.click(); + first.trigger('click'); assertEquals("ABC", c.scope.greeting); - second.click(); + second.trigger('click'); assertTrue(second.hasClass("ng-exception")); }; diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index fe61c520..e50f6ae7 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -75,21 +75,22 @@ describe('compiler', function(){ it('should allow creation of templates', function(){ directives.duplicate = function(expr, element){ + var parent = element.parent(); element.replaceWith(document.createComment("marker")); element.removeAttr("duplicate"); var template = this.compile(element); return function(marker) { this.$onEval(function() { - marker.after(template(element.clone()).element); + marker.after(template(element.clone()).$element); }); }; }; var scope = compile('beforexafter'); - expect(sortedHtml(scope.$element)).toEqual('