According to Islamic teachings, as the human being is tested through good, it is also possible that the human being is tested through evil. It is narrated from Imam Sadeq (AS) who said: Imam Ali (AS) was ill and a group came to visit him. They said:
How are you Amiral Momeneen? Imam Ali (AS) replied: I have been entangled with evil. They said: Sobhan-Allah! It is not right for you to say such thing! Imam Ali (AS) said: Allah (SWT) said in the Quran: “God tests you all through the bad and the good, and to God you will all return [1].” Imam Ali (AS) added: Therefore, good is the same as health and wealth; and bad is the same as illness and poverty which the human being is entangled with to be tested [2].
In fact, according to the Islamic teachings, every human being including the prophets and Imams may be tested through bad, such as poverty, illness, and others. But the human being must know that all these are inflicted through Divine Wisdom; and with all these good and bad events as tests, God wants the human being reach accomplishment and return to Allah (SWT) at all the times.
[1] Ayah 35, Surah Al-Anbia.
[2] Beharul Anwaar, Vol. 7, Page 209.
Source: en.shafaqna.com