From cc9f1fdf38bb179166212382b33e78255e669e73 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 21 Apr 2011 16:32:05 -0700 Subject: Proper handling of special attributes in jqlite --- test/jqLiteSpec.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 3486fbbb..5aec0cff 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -128,7 +128,7 @@ describe('jqLite', function(){ describe('attr', function(){ - it('shoul read wirite and remove attr', function(){ + it('shoul read write and remove attr', function(){ var selector = jqLite([a, b]); expect(selector.attr('prop', 'value')).toEqual(selector); @@ -147,6 +147,21 @@ describe('jqLite', function(){ expect(jqLite(a).attr('prop')).toBeFalsy(); expect(jqLite(b).attr('prop')).toBeFalsy(); }); + + it('should read special attributes as boolean', function(){ + var select = jqLite('').attr('multiple')).toEqual(true); + expect(jqLite('').attr('multiple')).toEqual(true); + + select.attr('multiple', false); + expect(select.attr('multiple')).toEqual(false); + + select.attr('multiple', true); + expect(select.attr('multiple')).toEqual(true); + }); + }); -- cgit v1.2.3