Test events handling