From a930e782a56eca047130e5a32f1ce97a0da05927 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 4 Oct 2010 23:42:21 -0700 Subject: removing anchor spec and improving jqLite.trigger() method - removing the last anchor spec because it can't run reliably in all browsers - improving jqLite.trigger() method --- src/jqLite.js | 7 ++++--- test/widgetsSpec.js | 23 ----------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/jqLite.js b/src/jqLite.js index 7a1c2dc8..2f32b121 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -119,9 +119,10 @@ JQLite.prototype = { }, trigger: function(type) { - var evnt = document.createEvent('MouseEvent'); - evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, _null); - this[0].dispatchEvent(evnt); + var evnt = document.createEvent('MouseEvents'), + element = this[0]; + evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); + element.dispatchEvent(evnt); }, replaceWith: function(replaceNode) { diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index a4bcf7b6..d2a39535 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -500,20 +500,6 @@ describe("widget", function(){ }); describe('a', function() { - - beforeEach(function() { - //TODO (igor): lame workaround for - //http://code.google.com/p/js-test-driver/issues/detail?id=144 - document.location.hash = ''; - }); - - - afterEach(function() { - //TODO (igor): see beforeEach - document.location.hash = ''; - }); - - it('should prevent default action to be executed when href is empty', function() { var orgLocation = document.location.href, preventDefaultCalled = false, @@ -546,15 +532,6 @@ describe("widget", function(){ expect(document.location.href).toEqual(orgLocation); }); - - - it('should change location when href is nonempty', function() { - var orgLocation = document.location.href; - - compile('goto'); - click(element); - expect(document.location.href).toEqual(orgLocation + 'newLocation'); - }); }); }); -- cgit v1.2.3