add spy object to test focus event

fixes remaining issue for #9972