Unit test for PR #10024 (event chaining fix)

@zaggino @MarcelGerber Can one of you review this?  "Needs a unit test" would have been my one comment on PR #10024 if I'd had time to review it :-)