I'm creating a jQuery UI autocomplete widget passing in a callback function, like this:
input.autocomplete( {
...,
select: function ( event, ui ) {
valueField.val( ui.item.id );
},
...
} );
How can I unit test the select function to assert that when it's called the valueField is updated with the correct value?