aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorIgor Minar2010-10-04 08:53:24 -0700
committerIgor Minar2010-10-04 08:53:24 -0700
commit328ff6c9265a16ae51cb01a8779445819f4118a1 (patch)
tree01b18ff1ab0b5f413f23843a817b0f1a8f3413dd /test/widgetsSpec.js
parent87f9a4c5660903893ccceca15987cf00d1495758 (diff)
downloadangular.js-328ff6c9265a16ae51cb01a8779445819f4118a1.tar.bz2
adding missing spec for 'A' widget
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js25
1 files changed, 24 insertions, 1 deletions
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('<a href="#newLocation">goto</a>');
+ click(element);
+ expect(document.location.href).toEqual(orgLocation + 'newLocation');
+ });
+ });
});