I remember one time Ustaz Muhammad telling us of the reason why Allah tests people of faith.
And that is to raise their standing amongst men and also in Allah's eyes - upon them succeeding in overcoming their challenges.
Which they do through perseverance, patience, prayer and constantly remembering Allah.
And Allah tests his servants only as to what can be shouldered by them.
And never despair of Allah's guidance and rewards, and always keep in gratitude of his Rahmah.