mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-26 11:10:25 +00:00
adding missing spec for 'A' widget
This commit is contained in:
parent
87f9a4c566
commit
328ff6c926
1 changed files with 24 additions and 1 deletions
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue