I implemented the following behavior for the input field: if the user clicks on the field, he will set all the input value as a choice;
$('.my_div input').on('click', function(event){
this.setSelectionRange(0, this.value.length);
}
);
Now I'm not quite sure how to test this behavior. The rough idea is to invoke a click, and then check the field selection. But, unfortunately, I have no idea how to select the current input selection.
Any advice regarding a testing approach for the described behavior is appreciated!
source
share