diff options
author | Przemyslaw Ciezkowski <p.ciezkowski@samsung.com> | 2013-04-05 18:11:50 +0200 |
---|---|---|
committer | Youmin Ha <youmin.ha@samsung.com> | 2013-04-10 23:57:34 +0900 |
commit | c5756917f402677d6b8585a5ddec9592038ba473 (patch) | |
tree | 9f49188dec53d10eae4984359e2689cb150c04c0 | |
parent | 3d1168a17cd9f224baa00cfab38fe44001798cc5 (diff) | |
download | web-ui-fw-c5756917f402677d6b8585a5ddec9592038ba473.tar.gz web-ui-fw-c5756917f402677d6b8585a5ddec9592038ba473.tar.bz2 web-ui-fw-c5756917f402677d6b8585a5ddec9592038ba473.zip |
Tests: Core tests for disableSelection
Change-Id: Ib8d41667dc43aca65d52537da3a8645451697672
-rw-r--r-- | tests/unit-tests/core/core-tests.js | 25 | ||||
-rw-r--r-- | tests/unit-tests/core/index.html | 46 | ||||
-rwxr-xr-x | tests/unit-tests/tests.js | 1 |
3 files changed, 72 insertions, 0 deletions
diff --git a/tests/unit-tests/core/core-tests.js b/tests/unit-tests/core/core-tests.js new file mode 100644 index 00000000..a4811e47 --- /dev/null +++ b/tests/unit-tests/core/core-tests.js @@ -0,0 +1,25 @@ +/* + * Unit Test: Core + * + * Przemyslaw Ciezkowski <p.ciezkowski@samsung.com> + */ + +$( "#corepage" ).live( "pageinit", function ( event ) { + module("Core"); + + test( "Disable text selection", function () { + var all = $( event.target ).find("*"), + haveDisabled = all.not( "input, [type='text'], textarea" ), + haveEnabled = all.filter( "input, [type='text'], textarea" ); + $.mobile.tizen.disableSelection( $( event.target ) ); + + haveDisabled.each( function () { + strictEqual( $(this).css( "user-select" ), "none" ); + } ); + + haveEnabled.each( function () { + strictEqual( $(this).css( "user-select" ), "text" ); + } ); + } ); + +} );
\ No newline at end of file diff --git a/tests/unit-tests/core/index.html b/tests/unit-tests/core/index.html new file mode 100644 index 00000000..a7fd702a --- /dev/null +++ b/tests/unit-tests/core/index.html @@ -0,0 +1,46 @@ +<!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-white" + data-framework-viewport-scale=false> + </script> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> + <script src="core-tests.js"></script> + <title>Core</title> +</head> + +<body> + +<h1 id="qunit-header">Core</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="corepage"> + <div data-role="header" data-position="fixed"> + <h1>Single-Page Application </h1> + </div><!-- /header --> + + <div data-role="content"> + <p>This is a single page boilerplate template that you can copy to build your first Tizen Web UI Framework page.</p> + <input type="text" /> + <input type="button" value="Test" /> + <button>Test</button> + <textarea></textarea> + </div><!-- /content --> + + <div data-role="footer" data-position="fixed"> + <h4>Footer content</h4> + </div><!-- /footer --> + </div><!-- /page --> +</div> + +</body> +</html> diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js index 5758f947..1f174c5f 100755 --- a/tests/unit-tests/tests.js +++ b/tests/unit-tests/tests.js @@ -2,6 +2,7 @@ var TESTS = { "testPages":[ // Put your test here "button", + "core", "check", "tabbar", "datetimepicker", |