add spy object to test focus event

fixes remaining issue for #9972 
I wonder if this simplifies the test to the point where we should just remove it.  It doesn't do what its name suggests anymore, and that might invite someone "fixing" it later and introducing the intermittent failure that we're fixing here.  Maybe we should add a comment explaining why we can't test `hasFocus()` in any unit tests?