A diagnosis alone does not remove testamentary capacity.
A diagnosis such as dementia does not remove testamentary capacity as a matter of course. What matters is the state at the time the will was drawn up. Without concrete indications of impairment, testamentary capacity is to be assumed.
Anyone who has doubts must support them with evidence.