Add tests for publishing events