Skip to content

Commit 328ff6c

Browse files
committed
adding missing spec for 'A' widget
1 parent 87f9a4c commit 328ff6c

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

test/widgetsSpec.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,20 @@ describe("widget", function(){
500500
});
501501

502502
describe('a', function() {
503+
504+
beforeEach(function() {
505+
//TODO (igor): lame workaround for
506+
//http://code.google.com/p/js-test-driver/issues/detail?id=144
507+
document.location.hash = '';
508+
});
509+
510+
511+
afterEach(function() {
512+
//TODO (igor): see beforeEach
513+
document.location.hash = '';
514+
});
515+
516+
503517
it('should prevent default action to be executed when href is empty', function() {
504518
var orgLocation = document.location.href,
505519
preventDefaultCalled = false,
@@ -532,6 +546,15 @@ describe("widget", function(){
532546

533547
expect(document.location.href).toEqual(orgLocation);
534548
});
535-
})
549+
550+
551+
it('should change location when href is nonempty', function() {
552+
var orgLocation = document.location.href;
553+
554+
compile('<a href="#newLocation">goto</a>');
555+
click(element);
556+
expect(document.location.href).toEqual(orgLocation + 'newLocation');
557+
});
558+
});
536559
});
537560

0 commit comments

Comments
 (0)