diff options
| author | Igor Minar | 2011-09-15 00:47:15 +0200 | 
|---|---|---|
| committer | Igor Minar | 2011-09-16 02:44:32 +0200 | 
| commit | 0e5a24c584d88b17297010676b8e0005b3545efd (patch) | |
| tree | 7a7e1a75b4c6fcb382b340d90cddef0913f5c325 /test/jqLiteSpec.js | |
| parent | 4e8f0d6e9ff1b852de9de9da72d0fac138bcd1a7 (diff) | |
| download | angular.js-0e5a24c584d88b17297010676b8e0005b3545efd.tar.bz2 | |
fix(specs): jQuery now returns attr name instead of true/false for special attrs
for special attrs like 'checked' or 'multiple', jquery now returns the name or undedefined.
e.g. foo.attr('checked') => 'checked' || undefined
The solution is a combination of updating our tests as well as switching
over to prop() instead which properly returns true/false
Diffstat (limited to 'test/jqLiteSpec.js')
| -rw-r--r-- | test/jqLiteSpec.js | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index a7fded5c..b31b1664 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -150,18 +150,18 @@ describe('jqLite', function(){        expect(jqLite(b).attr('prop')).toBeFalsy();      }); -    it('should read special attributes as boolean', function(){ +    it('should read special attributes as strings', function(){        var select = jqLite('<select>'); -      expect(select.attr('multiple')).toEqual(false); -      expect(jqLite('<select multiple>').attr('multiple')).toEqual(true); -      expect(jqLite('<select multiple="">').attr('multiple')).toEqual(true); -      expect(jqLite('<select multiple="x">').attr('multiple')).toEqual(true); +      expect(select.attr('multiple')).toBeUndefined(); +      expect(jqLite('<select multiple>').attr('multiple')).toBe('multiple'); +      expect(jqLite('<select multiple="">').attr('multiple')).toBe('multiple'); +      expect(jqLite('<select multiple="x">').attr('multiple')).toBe('multiple');        select.attr('multiple', false); -      expect(select.attr('multiple')).toEqual(false); +      expect(select.attr('multiple')).toBeUndefined();        select.attr('multiple', true); -      expect(select.attr('multiple')).toEqual(true); +      expect(select.attr('multiple')).toBe('multiple');      });      it('should return undefined for non-existing attributes', function() { | 
