This repository was archived by the owner on Oct 8, 2021. It is now read-only.
File tree 3 files changed +51
-0
lines changed
tests/unit/individual-modules
3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 10
10
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
11
11
12
12
define ( [ "jquery" ,
13
+ "../../vmouse" ,
13
14
"../../navigation/path" ,
14
15
"../../core" ,
15
16
"../../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