Finally got event handler test working in separate js file, the issue was a problem with the doc.ready alias