Rework test code to check order of event execution