Fix test assertion to check isValid result