The Family Of Imran - 3:152 Allah kept His promise to you, and indeed you destroyed them by His permission. But after He showed you what you loved, you hesitated and quarreled among yourselves about the war and did not listen to the orders. Some of you wanted the world and some the Hereafter. Then He turned you away from them as a test and forgave you in spite of everything. Allah is bountiful to those who believe
Related:
The Spoils of War/8:5 Indeed, your Lord took you out of your home for the fulfillment of a certain plan. A group of the believers disliked it.
The Spoils of War/8:6 They were disputing with you about it as if they were being driven to death while the truth was revealed.
The Spoils of War/8:7 Allah had promised you to defeat one of the two groups, but you wanted to meet the weaker of the two. But Allah wishes to realize the truth by His words and to cut off the pursuit of the disbelievers.

The Family Of Imran/3:152 Allah kept His promise to you, and indeed you destroyed them by His permission. But after He showed you what you loved, you hesitated and quarreled among yourselves about the war and did not listen to the orders. Some of you wanted the world and some the Hereafter. Then He turned you away from them as a test and forgave you in spite of everything. Allah is bountiful to those who believe

The Coalition/33:22 "When the believers see the parties (ready to attack), they say, "This is what Allah and His messenger promised us. Allah and His messenger have spoken the truth."This (dangerous situation) only strengthened their faith and submission."