mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-18 19:41:06 +00:00
added type attribute regex tests for the different ways that browsers serialize html
This commit is contained in:
parent
cd654a4eae
commit
b56626fba1
1 changed files with 15 additions and 1 deletions
|
|
@ -2,7 +2,10 @@
|
|||
* mobile page unit tests
|
||||
*/
|
||||
(function($){
|
||||
module('jquery.mobile.page.js');
|
||||
var libName = 'jquery.mobile.page.js',
|
||||
typeAttributeRegex = $.mobile.page.prototype._typeAttributeRegex;
|
||||
|
||||
module(libName);
|
||||
|
||||
test( "nested header anchors aren't altered", function(){
|
||||
ok(!$('.ui-header > div > a').hasClass('ui-btn'));
|
||||
|
|
@ -31,4 +34,15 @@
|
|||
test( "no auto-generated back button exists on first page", function(){
|
||||
ok( !$('.ui-header > [data-rel="back"]').length );
|
||||
});
|
||||
|
||||
test( "input type replacement regex works properly", function(){
|
||||
ok(typeAttributeRegex.test( "<input type=range" ), "test no quotes" );
|
||||
ok(typeAttributeRegex.test( "<input type='range'" ), "test single quotes" );
|
||||
ok(typeAttributeRegex.test( "<input type=\"range\"" ), "test double quotes" );
|
||||
ok(typeAttributeRegex.test( "<input type=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"), "test \w" );
|
||||
ok(typeAttributeRegex.test( "<input type=\"range\"" ), "test many preceding spaces" );
|
||||
ok(typeAttributeRegex.test( "<input type='range'>" ), "test final attribute (FF)" );
|
||||
|
||||
ok(!typeAttributeRegex.test( "<inputtype=\"range\"" ), "requires preceding space" );
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue