From 328ff6c9265a16ae51cb01a8779445819f4118a1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 4 Oct 2010 08:53:24 -0700 Subject: adding missing spec for 'A' widget --- test/widgetsSpec.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index edaa5061..a4bcf7b6 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -500,6 +500,20 @@ 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, @@ -532,6 +546,15 @@ 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