Write tests for system/events.
Address review comments.
Merge pull request #711 from Gozala/bug/system-event-tests@825215

fix Bug 825215 - Write tests for system/events. r=@ochameau