Assalamualaikum wa rahmatullahi wa barakatuh,
Allah aza wa jal says that no matter what you do, even if you did every good deed in the world, you will still be tested, as he says here:
Or do you think that you will enter Paradise while such [trial] has not yet come to you as came to those who passed on before you? They were touched by poverty and hardship and were shaken until [even their] messenger and those who believed with him said,"When is the help of Allah ?" Unquestionably, the help of Allah is near. (2:214 - Noble Quran)
And We will surely test you with something of fear and hunger and a loss of wealth and lives and fruits, but give good tidings to the patient, Who, when disaster strikes them, say, "Indeed we belong to Allah, and indeed to Him we will return." Those are the ones upon whom are blessings from their Lord and mercy. And it is those who are the [rightly] guided. (2:155-157 - Noble Quran)
In the above two verses, Allah promises that you will be tested with hardships no matter what you do, and that no one can enter paradise without being tested. So this should increase you in faith, what Allah promised would happen, is happening, Allah's promise came true.
So this misconception that you have, where you think if you do such and such good deeds, you will avoid some type of test, needs to be avoided, this is simply a whisper from shaytan where he wants you to think Allah is not fulfilling his side of the bargain. This is the deal. You believe in Allah alone, worship him alone, do good deeds, and avoid the great sins, and paradise is yours. That's the deal. Allah doesn't promise you an easy life, Allah doesn't promise you that you'll avoid every evil thing in this world, rather, Allah says:
Indeed, Allah has purchased from the believers their lives and their properties [in exchange] for that they will have Paradise. They fight in the cause of Allah, so they kill and are killed. [It is] a true promise [binding] upon Him in the Torah and the Gospel and the Qur'an. And who is truer to his covenant than Allah ? So rejoice in your transaction which you have contracted. And it is that which is the great attainment. (9:111 - Noble Quran)
So Allah PURCHASED your soul, in exchange for paradise. That means, Allah gets to do whatever he wants to your life, put you in any situation he pleases, and in exchange, you will have eternity in paradise where all desires are fulfilled, greater than any treasure. That's how it is.
Now the wisdom behind the testing is understandable. We Muslims believe in multiple heavens one on top of each other with varying levels/degrees, and the higher you go the more enjoyable it will be forever, in the hereafter, you will have all desires fulfilled, and you will desire what you EARN, you will be happy for those above you as you know they earned those higher ranks over you and will be content with your current level. So you want to go as high as possible to enjoy paradise more forever.
How do you get to the highest level? Prophet Muhammad (sallahallahu alaihi wasalam) said a few things about that.
He said, that there are some people in the world who, no matter how many good deeds they do, will never be able to reach the higher levels of paradise due to the difficulty in reaching them, so Allah tests them with hardships so that they can earn those higher levels AS LONG AS they're patient seeking Allah's reward. So the highest levels of paradise are not attainable except through patience in difficulties.
The Prophet (s) said every person has a predestined place in hell and heaven, and your actions determine what direction you go, if you are heading towards paradise but lack the good deeds to reach the predestined level that is high in Jannah, then Allah will give you hardships so you can catch up and reach it with patience.
Allah rewards all good deeds by multiplying them between 10-700, except two good deeds: fasting and patience, Fasting and patience will be rewarded more than 700 personally by Allah.
The above proves that the wisdom behind tests is to raise your status/rank in the hereafter, that Allah is doing this testing FOR you, not against you, and that if you were not doing all these good deeds you said you're doing, then imagine how much more harder your life would be right now. This is a good sign, it means, even with all these good deeds, you still have room to go higher in Jannah, so Allah is helping you reach that level.
Likewise, hardships can also be punishments, not just tests. You should examine your life and see if you are committing any sins. Allah punishes sins in this life with hardships so that you will come to him sinless, any pain you feel, Allah wipes away sins, and every sin weakens faith. The scholars state there are two ways (that I know) you can tell if you are being punished or tested to be raised a higher rank. One is if you are being impatient/hasty/anxious, then it is a punishment, because Allah knows you wouldn't be able to handle the hardship with patience, so it is a punishment. The second depends on the circumstance, if you get an std from fornication for example, or if you get caught cheating in adultery and lose your wealth, etc these are obviously punishments.
The scholars state that if you are undergoing punishment, but are patient, then you will earn the reward of one who is being tested and have your rank raised, and sins wiped away.
The wisdom behind going through the testing on Earth.
Indeed, we offered the Trust to the heavens and the earth and the mountains, and they declined to bear it and feared it; but man [undertook to] bear it. Indeed, he was unjust and ignorant. (33:72 - Noble Quran)
the "Trust" means to be rewarded for good and punished for evil. So mankind AGREED to take the test beforehand. Prophet Adam (alaihi salam), on behalf of mankind, accepted the Trust, and he was more wise and pious than anyone, as he is a Prophet and Messenger. Likewise Allah says:
And [mention] when your Lord took from the children of Adam - from their loins - their descendants and made them testify of themselves, [saying to them], "Am I not your Lord?" They said, "Yes, we have testified." [This] - lest you should say on the day of Resurrection, "Indeed, we were of this unaware." (7:172 - Noble Quran)
That means, all of mankind, including you and me, were brought forth before being put on Earth, and we all accepted Allah as our Lord and accepted his decree.
Likewise, Allah explains why he doesn't punish without warning in the Noble Quran (or reward without testing). Had he thrown disbelievers into hell upon creation then they would have had excuses, swearing they would have believed had they been given the chance. So this life is being used to gain evidences, for us, so that there will be no arguments. This also works for the people of paradise. If you believe you should be raised higher in paradise than someone else, then this life proves it with your deeds and strength of faith in Allah. When you are placed in your rank, the evidences will be presented on the day of judgment, and there will be no arguing for a higher rank.
That is the wisdom behind being tested in this life, and it's only for a short time. The concept of time in Jannah is very different. I could walk outside and stare at a rose for 50 years, bam that's your entire life almost right there, just staring at a rose. So it is a short time. Allah promises in the Quran that every hardship has relief, and that he doesn't give you tests you can't handle. So have patience, seek Allah's reward, keep struggling and making dua, everything starts with dua.
Patience is your ONLY option. Perhaps the jobs you're applying to aren't halal, or they aren't good for you, some people spend years searching for jobs, how long have you spent? Some people are in war zones right now like Syria, Somalia, Mali, and Yemen where the Mushrikeen are killing Muslims in all four corners of the world, and you're worried about some job? Subhanallah, count your blessings sisters. You have your eye sight. you have intelligence. You have your faith. Allah enabled you to do all these good deeds. Subhanallah, you are blessed, count your blessings and have patience.
As for me, I went through something similar, and I wear the Islamic beard, and eventually got a job, that Allah made me do well in, now I am in the process of opening up my own business, I'm on my first vacation in 8 years Subhanallah, so things do eventually get easier. Alhamdullilah