spy window.confirm to avoid dialog box when running JS tests