From b56626fba18d6b5ac939ba0577490b4a11b404ad Mon Sep 17 00:00:00 2001 From: John Bender Date: Mon, 14 Mar 2011 23:49:07 -0700 Subject: [PATCH] added type attribute regex tests for the different ways that browsers serialize html --- tests/unit/page/page_core.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/unit/page/page_core.js b/tests/unit/page/page_core.js index e21e1c77..805d9caa 100644 --- a/tests/unit/page/page_core.js +++ b/tests/unit/page/page_core.js @@ -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( "" ), "test final attribute (FF)" ); + + ok(!typeAttributeRegex.test( "