focusing on the key when an object property is added

This issue was annoying me when using Huginn so I created this patch.

The only problem is I can't get the test to work (although it's clearly working when testing manually).
Any ideas on how to fix this test? Jasmine apparently can't recognise which element is focused as document.activeElement returns the body tag after the click event is triggered.

Thanks