Fix test after refactoring event registration