In the Name of Allah, the All Merciful, the Mercy-Giving
All praise is due to Allah. Peace and blessings be upon His Messenger Muhammad.
Yes, sister, it was a test. In fact, the entire worldly life is a big test. Sometimes we win and some other times we fail. But a Muslim should never despair or get entrapped in the feeling of guilt. Allah (exalted is He) said, “Say, [O Prophet]: O My servants! Those [of you] who have committed [sins in great] excess against their own souls, never despond of the mercy of God!
For, indeed, God forgives sins, one and all. Indeed, it is He [alone] who is the All-Forgiving, the Mercy-Giving.” [39:53] The door of repentance is always there, but you need to keep knocking sincerely until it is open. When the Satan entraps a Muslim, the best reaction is to seek Allah’s help and forgiveness. This turns the failure into success and replaces bad deeds with good ones.
That was a lesson you must have learnt. Just look ahead and seek Allah’s forgiveness for the past and help for the future. Never let compunction hinder your life. Let it be a thrust for a better future and better relation with Allah SWT.
Allah Almighty knows best.