5 $.mobile.defaultTransition = "none";
7 module( "PageControl" );
9 test( "Basic pagecontrol test", function ( ) {
10 var pc = $( '<div data-role="pagecontrol"></div>' )
19 ok( pc, "pagecontrol object creation" );
20 nb = pc.children( 'div.page_n' )[1]; // 2nd button
22 ok( $(nb).hasClass( 'page_n_2' ), "first button should be activated" );
23 equal( $( pc ).pagecontrol( "value" ), 2, "value() method must return 2" );
25 nb = pc.children( 'div.page_n' )[9];
26 ok( nb, "last number button should exist" );
27 pc.one( "change", function( ev, val ) {
28 equal( val, 10, "pagecontrol element's value must be set when click event comes." );
29 ok( $( nb ).hasClass( 'page_n_10' ), "after click, clicked button should be changed to number type" );
30 equal( $( pc ).pagecontrol( "value" ), 10, "value() method must return 10" );
32 $( pc ).pagecontrol( "value", 5 );
33 equal( $( pc ).pagecontrol( "value" ), 5, "value() method must return 5 after running .value(5)" );
36 $(nb).trigger( "click" );