Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
selection.update([
{
id: '1',
text: 'One'
}
]);
var $search = $selection.find('input');
var $choices = $selection.find('.select2-selection__choice');
assert.equal($search.length, 1, 'The search was visible');
assert.equal($choices.length, 1, 'The choice was rendered');
// Trigger the backspace on the search
var backspace = $.Event('keydown', {
which: KEYS.BACKSPACE
});
$search.trigger(backspace);
});