Fix test mock condition