Additional UnitTC: tizen winset unit tc bugs have been fixed
authorheeju.joo <heeju.joo@samsung.com>
Thu, 11 Apr 2013 12:22:29 +0000 (21:22 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Tue, 16 Apr 2013 04:38:22 +0000 (13:38 +0900)
slider-tests.js: equal assertion have been changed with ok, slider test html page structure have been changed
collapsible-tests.js: expected result have been modified
button-tests.js: parameter and if-else statement have been added

Change-Id: I2641885646faf6dbfe6b5bed9d6b4a4947ac4779

tests/additional-unit-tests/button/button-tests.js
tests/additional-unit-tests/collapsible/collapsible-tests.js
tests/additional-unit-tests/slider/index.html
tests/additional-unit-tests/slider/slider-tests.js

index 5a53ddb..9f4c02e 100755 (executable)
@@ -10,7 +10,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
 
        module ("button") ;
 
-       var unit_button = function ( widget, type ) {
+       var unit_button = function ( widget, type, text ) {
                var buttonClassPrefix = "ui-btn",
                        buttonText = type,
                        icon,
@@ -33,7 +33,11 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
                // Text Trim, CausejQueryMobile ( JQM ) 1.1 forced to add -"\u00a0"in buttonIcon ( ButtonMarkup )
                // JQM 1.1 buttonMarkup code :
                // - if ( buttonIcon ) buttonIcon.appendChild ( document.createTextNode ("\u00a0") ) ;
-               equal ( widget.text ( ).trim ( ) , buttonText , "Button Text") ;
+               if ( buttonText == "") {
+                       equal ( widget.text ( ).trim ( ) , text , "Button Text icon only") ;
+               } else {
+                       equal ( widget.text ( ).trim ( ) , buttonText , "Button Text");
+               }
                icon = widget.jqmData ("icon") ;
                if ( icon !== undefined ) {
                        ok ( widget.children ( ).children ( ).hasClass ("ui-icon-" + icon ) , "Style - Button Icon") ;
@@ -121,15 +125,15 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
        } ) ;
 
        test ("Button - Inline, Only Icon ( Reveal )", function ( ) {
-               unit_button ( $("#button-4") , "Non Text Button") ;
+               unit_button ( $("#button-4") , "Non Text Button", "reveal") ;
        } ) ;
 
        test ("Button - Inline, Only Icon ( Send ) , circle", function ( ) {
-               unit_button ( $("#button-5") , "Non Text Button") ;
+               unit_button ( $("#button-5") , "Non Text Button", "send") ;
        } ) ;
 
        test ("Button - Inline, Only Icon ( Favorite ) , nobackground", function ( ) {
-               unit_button ( $("#button-6") , "Non Text Button") ;
+               unit_button ( $("#button-6") , "Non Text Button", "favorite") ;
        } ) ;
 
        test ("Button", function ( ) {
@@ -187,7 +191,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
                markup = '<div data-role = "button" id = "button-4">Non Text Button Dynamic</div>';
                $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
                $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
-               unit_button ( $("#button-4") , "Non Text Button Dynamic") ;
+               unit_button ( $("#button-4") , "Non Text Button Dynamic", "reveal") ;
 
        } ) ;
 
@@ -199,7 +203,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
                markup = '<div data-role = "button" id = "button-5">Non Text Button Dynamic</div>';
                $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
                $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
-               unit_button ( $("#button-5") , "Non Text Button Dynamic") ;
+               unit_button ( $("#button-5") , "Non Text Button Dynamic", "send") ;
 
        } ) ;
 
@@ -211,7 +215,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) {
                markup = '<div data-role = "button" id = "button-6">Non Text Button Dynamic</div>';
                $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
                $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
-               unit_button ( $("#button-6") , "Non Text Button Dynamic") ;
+               unit_button ( $("#button-6") , "Non Text Button Dynamic", "favorite") ;
 
        } ) ;
 
index b6a17ef..45fe526 100755 (executable)
@@ -16,8 +16,8 @@
                equal( widget.hasClass('ui-collapsible'), true, "Markup check") ;
 
                /* Check Option */
-               equal( obj_collapse.options.expandCueText, " click to expand contents", "Collapsed test -> expandCueText");
-               equal( obj_collapse.options.collapseCueText, " click to collapse contents", "Collapsed test -> collapseCueText");
+               equal( obj_collapse.options.expandCueText, " Expandable list, tap to open list", "Collapsed test -> expandCueText");
+               equal( obj_collapse.options.collapseCueText, " Expandable list, tap to close list", "Collapsed test -> collapseCueText");
                equal( obj_collapse.options.collapsed, true, "Collapsed test -> collapsed");
                equal( obj_collapse.options.heading, "h1,h2,h3,h4,h5,h6,legend,li", "Collapsed test -> heading");
                equal( obj_collapse.options.theme, 's', "Collapsed test -> theme");
index fac80d6..459e558 100755 (executable)
@@ -9,7 +9,6 @@
        </script>
 
        <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
-
        <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
        <script src="slider-tests.js"></script>
 
@@ -17,7 +16,6 @@
 </head>
 
 <body>
-
 <h1 id="qunit-header">Slider</h1>
 <h2 id="qunit-banner"></h2>
 <div id="qunit-testrunner-toolbar"></div>
 <ol id="qunit-tests"></ol>
 
 <div id="qunit-fixture">
-
        <div data-role="page" id="sliderpage1">
                <div data-role="header" data-position="fixed">
                        <h1>Slider</h1>
                </div>
                <div data-role="content">
                        <input id="slider0" data-popup="false" type="range" name="slider" value="50" min="0" max="100"></input>
-               </div>
-       </div>
-       
-       <div data-role="page" id="sliderpage2">
-               <div data-role="header" data-position="fixed">
-                       <h1>Slider</h1>
-               </div>
-               <div data-role="content">               
                        <input id="slider1" data-popup="false" type="range" name="slider" value="5" min="0" max="10" data-icon="volume"></input>
                </div>
        </div>
 </div>
-
 </body>
 </html>
index fc1c582..05dc130 100755 (executable)
@@ -43,12 +43,13 @@ $( document ).ready( function ( ) {
                equal( handle.attr("aria-valuemin" ), widget.attr("min" ), "Paramter : min" );
                equal( handle.attr("aria-valuemax" ), widget.attr("max" ), "Paramter : max" );
 
-               equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Default" );
+               ok( Math.abs(parseInt( handle.css("left") ) - handle_left( widget, slider ) ) <= 1, "Handle Location: Default" );
 
                /* Check APIs */
                widget.val( random_move( widget.attr("min" ), widget.attr("max" ) ) );
                widget.trigger("change" );
-               equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Moved" );
+               ok( Math.abs(parseInt( handle.css("left") ) - handle_left( widget, slider ) ) <= 1, "Handle Location: Moved" );
+
                if ( widget.jqmData('popup') == true ) {
                        popup = slider.find(".ui-slider-handle-press" );
                        ok( popup, "Popup present" );
@@ -68,14 +69,15 @@ $( document ).ready( function ( ) {
 
        };
 
+       $('#sliderpage1').page( ) ;
+
        test( "normal slider", function ( ) {
-               $('#sliderpage1').page( ) ;
                unit_slider( $("#slider0" ) );
        } );
 
        test( "icon slider", function ( ) {
-               $('#sliderpage2').page( ) ;
                unit_slider( $("#slider1" ) );
        } );
 
+
 } );