From 26b1d1636aeda7c731d85b6e86df8ebb20d230b8 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 3 Apr 2014 12:50:23 +0300 Subject: [PATCH] Checkboxradio: Depend on vmouse and test custom, widget-only-build (cherry picked from commit dc3fa7deb797a54f43b7648a6ae83d574b2a228f) Closes gh-7295 Fixes gh-7294 Re gh-5987 --- js/widgets/forms/checkboxradio.js | 1 + .../checkboxradio-tests.html | 36 +++++++++++++++++++ .../individual-modules/checkboxradio_core.js | 14 ++++++++ 3 files changed, 51 insertions(+) create mode 100644 tests/unit/individual-modules/checkboxradio-tests.html create mode 100644 tests/unit/individual-modules/checkboxradio_core.js diff --git a/js/widgets/forms/checkboxradio.js b/js/widgets/forms/checkboxradio.js index b6c9d9c2111..48d061eb79d 100644 --- a/js/widgets/forms/checkboxradio.js +++ b/js/widgets/forms/checkboxradio.js @@ -10,6 +10,7 @@ //>>css.theme: ../css/themes/default/jquery.mobile.theme.css define( [ "jquery", + "../../vmouse", "../../navigation/path", "../../jquery.mobile.core", "../../jquery.mobile.widget", diff --git a/tests/unit/individual-modules/checkboxradio-tests.html b/tests/unit/individual-modules/checkboxradio-tests.html new file mode 100644 index 00000000000..a8386e7cfd8 --- /dev/null +++ b/tests/unit/individual-modules/checkboxradio-tests.html @@ -0,0 +1,36 @@ + + + + + + jQuery Mobile Collapsible Test Suite + + + + + + + + + + + + + + + + +
+ + + + diff --git a/tests/unit/individual-modules/checkboxradio_core.js b/tests/unit/individual-modules/checkboxradio_core.js new file mode 100644 index 00000000000..ba79749e48e --- /dev/null +++ b/tests/unit/individual-modules/checkboxradio_core.js @@ -0,0 +1,14 @@ +test( "Checkboxradio widget works correctly", function() { + var checkbox = $( "#the-checkbox" ).checkboxradio(), + initiallyChecked = checkbox.prop( "checked" ); + + deepEqual( checkbox.parent().hasClass( "ui-checkbox" ), true, + "Wrapper has class ui-checkbox" ); + deepEqual( checkbox.siblings( "label" ).hasClass( "ui-btn" ), true, + "Input has a sibling