diff options
| author | Igor Minar | 2013-02-14 15:13:50 -0800 | 
|---|---|---|
| committer | Igor Minar | 2013-02-14 16:42:58 -0800 | 
| commit | 37e8b12265291918396bfee65d444a8f63697b73 (patch) | |
| tree | c4eed144b5c9931c9ccb750b32213c5b55962c5e /test/ng/directive | |
| parent | 1ace5eb39632ae189fdabee176c6e918960d0578 (diff) | |
| download | angular.js-37e8b12265291918396bfee65d444a8f63697b73.tar.bz2 | |
fix(a): workaround IE bug affecting mailto urls
Apparently there is a really weird bug in IE6-8 that causes anchor textContent
to be reset with href content when both contain @ symbol.
Inserting a bogus comment node into all anchor elements in IE works around this
browser bug.
I'm fixing the issue via directive because that way we'll fix it for jQuery as
well.
I fixed an e2e test too because it was incorrect.
Closes #1949
Diffstat (limited to 'test/ng/directive')
| -rw-r--r-- | test/ng/directive/aSpec.js | 23 | 
1 files changed, 19 insertions, 4 deletions
diff --git a/test/ng/directive/aSpec.js b/test/ng/directive/aSpec.js index 8aa2449d..a284f4bc 100644 --- a/test/ng/directive/aSpec.js +++ b/test/ng/directive/aSpec.js @@ -1,7 +1,13 @@  'use strict';  describe('a', function() { -  var element; +  var element, $compile, $rootScope; + + +  beforeEach(inject(function(_$compile_, _$rootScope_) { +    $compile = _$compile_; +    $rootScope = _$rootScope_; +  }));    afterEach(function(){ @@ -9,8 +15,7 @@ describe('a', function() {    }); -  it('should prevent default action to be executed when href is empty', -      inject(function($rootScope, $compile) { +  it('should prevent default action to be executed when href is empty', function() {      var orgLocation = document.location.href,          preventDefaultCalled = false,          event; @@ -42,5 +47,15 @@ describe('a', function() {      }      expect(document.location.href).toEqual(orgLocation); -  })); +  }); + + +  it('should prevent IE for changing text content when setting attribute', function() { +    // see issue #1949 +    element = jqLite('<a href="">hello@you</a>'); +    $compile(element); +    element.attr('href', 'bye@me'); + +    expect(element.text()).toBe('hello@you'); +  });  });  | 
