Skip to content

Commit bf418bc

Browse files
committed
Stub _enhance method in _button method test
1 parent aa77b61 commit bf418bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/unit/widgets/forms/button.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ define([
2828
test( "_button", function() {
2929
var myButton, wrapper, _getIconClasses;
3030

31-
myButton = $.mobile.button( {}, $( "<input type='button' value='my button'>" ) );
31+
// Stub _enhance method so it doesn't actually get called
32+
this.stub( $.mobile.button.prototype, "_enhance" );
33+
3234
_getIconClasses = this.stub( $.mobile.button.prototype, "_getIconClasses" ).returns( "icon-class" );
35+
36+
myButton = $.mobile.button( {}, $( "<input type='button' value='my button'>" ) );
3337
wrapper = $.mobile.button.prototype._button.call( myButton );
3438
ok( _getIconClasses.calledOnce, "_getIconClasses should be called once" );
3539
ok( wrapper.hasClass( "icon-class" ), "button wrapper should have class icon-class" );

0 commit comments

Comments
 (0)