diff options
Diffstat (limited to 'tests/unit-tests/nocontents')
-rwxr-xr-x | tests/unit-tests/nocontents/index.html | 80 | ||||
-rw-r--r-- | tests/unit-tests/nocontents/nocontents-tests.js | 47 |
2 files changed, 127 insertions, 0 deletions
diff --git a/tests/unit-tests/nocontents/index.html b/tests/unit-tests/nocontents/index.html new file mode 100755 index 00000000..25aa56e4 --- /dev/null +++ b/tests/unit-tests/nocontents/index.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<html> +<head> + <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" + data-framework-theme="tizen-gray" + data-framework-viewport-scale=false> + </script> + + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" /> + + <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script> + <script src="nocontents-tests.js"></script> + + <title>No Contents</title> +</head> + +<body> + +<h1 id="qunit-header">No Contents</h1> +<h2 id="qunit-banner"></h2> +<div id="qunit-testrunner-toolbar"></div> +<h2 id="qunit-userAgent"></h2> +<ol id="qunit-tests"></ol> + +<div id="qunit-fixture"> + + <div data-role="page" id="nocontents0"> + <div data-role="header" data-position="fixed"> + <h1>No Contents</h1> + </div> + <div data-role="content"> + <div data-role="nocontents" id="nocontents_text" data-type="text"> + <p>text1</p> + <p>text2</p> + </div> + </div> + </div> + + <div data-role="page" id="nocontents1"> + <div data-role="header" data-position="fixed"> + <h1>No Contents</h1> + </div> + <div data-role="content"> + <div data-role="nocontents" id="nocontents_pic" data-type="picture"> + <p>text1</p> + <p>text2</p> + </div> + </div> + </div> + + <div data-role="page" id="nocontents2"> + <div data-role="header" data-position="fixed"> + <h1>No Contents</h1> + </div> + <div data-role="content"> + <div data-role="nocontents" id="nocontents_mul" data-type="multimedia"> + <p>text1</p> + <p>text2</p> + </div> + </div> + </div> + + <div data-role="page" id="nocontents2"> + <div data-role="header" data-position="fixed"> + <h1>No Contents</h1> + </div> + <div data-role="content"> + <div data-role="nocontents" id="nocontents_un" data-type="unnamed"> + <p>text1</p> + <p>text2</p> + </div> + </div> + </div> + +</div> + +</body> +</html> diff --git a/tests/unit-tests/nocontents/nocontents-tests.js b/tests/unit-tests/nocontents/nocontents-tests.js new file mode 100644 index 00000000..8e504cf3 --- /dev/null +++ b/tests/unit-tests/nocontents/nocontents-tests.js @@ -0,0 +1,47 @@ +/* + * Unit Test: Nocontents + * + * Minkyu Kang <mk7.kang@samsung.com> + */ + +(function ($) { + module("Nocontents"); + + var unit_nocontents = function ( widget, type ) { + var background, + text, + i; + + /* Create */ + widget.nocontents(); + + ok( widget.hasClass("ui-nocontents"), "Create" ); + + /* Check Background */ + background = widget.children( ".ui-nocontents-icon-" + type ); + ok( background, "Background" ); + + /* Check Texts */ + text = widget.children("p"); + + for ( i = 0; i < text.length; i++ ) { + ok( $( text[i] ).hasClass("ui-nocontents-text"), "Text" + i ); + } + }; + + test( "text type", function () { + unit_nocontents( $("#nocontents_text"), "text" ); + }); + + test( "picture type", function () { + unit_nocontents( $("#nocontents_pic"), "picture" ); + }); + + test( "multimedia type", function () { + unit_nocontents( $("#nocontents_mul"), "multimedia" ); + }); + + test( "unnamed type", function () { + unit_nocontents( $("#nocontents_un"), "unnamed" ); + }); +}( jQuery )); |