diff options
Diffstat (limited to 'test/jqLiteSpec.js')
| -rw-r--r-- | test/jqLiteSpec.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index f9102754..24795331 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -366,6 +366,25 @@ describe('jqLite', function(){ expect(jqLite(a).css('padding')).toBe('2px'); expect(jqLite(a).css('border')).toBeFalsy(); }); + + + it('should correctly handle dash-separated and camelCased properties', function() { + var jqA = jqLite(a); + + expect(jqA.css('z-index')).toBeOneOf('', 'auto'); + expect(jqA.css('zIndex')).toBeOneOf('', 'auto'); + + + jqA.css({'zIndex':5}); + + expect(jqA.css('z-index')).toBeOneOf('5', 5); + expect(jqA.css('zIndex')).toBeOneOf('5', 5); + + jqA.css({'z-index':7}); + + expect(jqA.css('z-index')).toBeOneOf('7', 7); + expect(jqA.css('zIndex')).toBeOneOf('7', 7); + }); }); @@ -747,4 +766,27 @@ describe('jqLite', function(){ expect(element.find('span').eq(20).length).toBe(0); }); }); + + + describe('camelCase', function() { + + it('should leave non-dashed strings alone', function() { + expect(camelCase('foo')).toBe('foo'); + expect(camelCase('')).toBe(''); + expect(camelCase('fooBar')).toBe('fooBar'); + }); + + + it('should covert dash-separated strings to camelCase', function() { + expect(camelCase('foo-bar')).toBe('fooBar'); + expect(camelCase('foo-bar-baz')).toBe('fooBarBaz'); + }); + + + it('should covert browser specific css properties', function() { + expect(camelCase('-moz-foo-bar')).toBe('MozFooBar'); + expect(camelCase('-webkit-foo-bar')).toBe('webkitFooBar'); + expect(camelCase('-webkit-foo-bar')).toBe('webkitFooBar'); + }) + }); }); |
