From c5756917f402677d6b8585a5ddec9592038ba473 Mon Sep 17 00:00:00 2001 From: Przemyslaw Ciezkowski Date: Fri, 5 Apr 2013 18:11:50 +0200 Subject: [PATCH] Tests: Core tests for disableSelection Change-Id: Ib8d41667dc43aca65d52537da3a8645451697672 --- tests/unit-tests/core/core-tests.js | 25 ++++++++++++++++++++ tests/unit-tests/core/index.html | 46 +++++++++++++++++++++++++++++++++++++ tests/unit-tests/tests.js | 1 + 3 files changed, 72 insertions(+) create mode 100644 tests/unit-tests/core/core-tests.js create mode 100644 tests/unit-tests/core/index.html diff --git a/tests/unit-tests/core/core-tests.js b/tests/unit-tests/core/core-tests.js new file mode 100644 index 0000000..a4811e4 --- /dev/null +++ b/tests/unit-tests/core/core-tests.js @@ -0,0 +1,25 @@ +/* + * Unit Test: Core + * + * Przemyslaw Ciezkowski + */ + +$( "#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 0000000..a7fd702 --- /dev/null +++ b/tests/unit-tests/core/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + Core + + + + +

Core

+

+
+

+
    + +
    +
    +
    +

    Single-Page Application

    +
    + +
    +

    This is a single page boilerplate template that you can copy to build your first Tizen Web UI Framework page.

    + + + + +
    + +
    +

    Footer content

    +
    +
    +
    + + + diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js index 5758f94..1f174c5 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", -- 2.7.4