This repository was archived by the owner on Oct 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
tests/unit/individual-modules Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1010//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
1111
1212define ( [ "jquery" ,
13+ "../../vmouse" ,
1314 "../../navigation/path" ,
1415 "../../jquery.mobile.core" ,
1516 "../../jquery.mobile.widget" ,
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
6+ < title > jQuery Mobile Collapsible Test Suite</ title >
7+
8+ < script src ="../../../external/requirejs/require.js "> </ script >
9+ < script src ="../../../js/requirejs.config.js "> </ script >
10+ < script src ="../../../js/jquery.tag.inserter.js "> </ script >
11+ < script src ="../../jquery.setNameSpace.js "> </ script >
12+ < script src ="../../../tests/jquery.testHelper.js "> </ script >
13+
14+ < link rel ="stylesheet " href ="../../../css/themes/default/jquery.mobile.css "/>
15+ < link rel ="stylesheet " href ="../../../external/qunit/qunit.css "/>
16+ < link rel ="stylesheet " href ="../../jqm-tests.css "/>
17+ < script src ="../../../external/qunit/qunit.js "> </ script >
18+ < script >
19+ $ . testHelper . asyncLoad ( [
20+ [
21+ "widgets/forms/checkboxradio"
22+ ] ,
23+ [
24+ "checkboxradio_core.js"
25+ ]
26+ ] ) ;
27+ </ script >
28+
29+ < script src ="../../swarminject.js "> </ script >
30+ </ head >
31+ < body >
32+ < div id ="qunit "> </ div >
33+
34+ < label > The Checkbox< input type ="checkbox " id ="the-checkbox "> </ label >
35+ </ body >
36+ </ html >
Original file line number Diff line number Diff line change 1+ test ( "Checkboxradio widget works correctly" , function ( ) {
2+ var checkbox = $ ( "#the-checkbox" ) . checkboxradio ( ) ,
3+ initiallyChecked = checkbox . prop ( "checked" ) ;
4+
5+ deepEqual ( checkbox . parent ( ) . hasClass ( "ui-checkbox" ) , true ,
6+ "Wrapper has class ui-checkbox" ) ;
7+ deepEqual ( checkbox . siblings ( "label" ) . hasClass ( "ui-btn" ) , true ,
8+ "Input has a sibling <label> with class ui-btn" ) ;
9+
10+ checkbox . siblings ( "label" ) . click ( ) ;
11+
12+ deepEqual ( checkbox . prop ( "checked" ) , ! initiallyChecked ,
13+ "Clicking the label toggles the checkbox" ) ;
14+ } ) ;
You can’t perform that action at this time.
0 commit comments