I have jQuery code for keyboard navigation, I need to write testcase using Mocha and Chai. This testcase can be executed when Esc key is pressed:
onEscapeClosePopup: function (e) {
if (e.keyCode === 27) {
$('.close-button span').trigger('click');
}
}