Mishkat al-Masabih
‘Ali reported God’s messenger as saying, “God loves the believing servant who is severely tried and is penitent.”
وَعَنْ عَلِيٍّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِنَّ اللَّهَ يُحِبُّ الْعَبْدَ المؤمنَ المفتَّنَ التوَّابَ»
Reference