Abu Saeed Khudri reported,

Some men from among the hypocrites during the time of the Messenger of Allah ﷺ would stay behind whenever the Prophet ﷺ went out on a military expedition, rejoicing in remaining behind while the Messenger of Allah ﷺ was away. When the Prophet ﷺ returned, they would offer him excuses and swear oaths, wishing to be praised for what they had not done. So this verse was revealed, "Do not think that those who rejoice in what they have done and love to be praised for what they have not done, do not think them safe from punishment" [Aal Imran 3:188].

Azami 15052

Sahih

عن أبي سعيد الخدري

أن رجالا من المنافقين في عهد رسول الله ﷺ كانوا إذا خرج النبي ﷺ إلى الغزو تخلفوا عنه، وفرحوا بمقعدهم خلاف رسول الله ﷺ، فإذا قدم النبي ﷺ اعتذروا إليه، وحلفوا، وأحبوا أن يحمدوا بما لم يفعلوا، فنزلت: {لا تحسبن الذين يفرحون بما أتوا ويحبون أن يحمدوا بما لم يفعلوا فلا تحسبنهم بمفازة من العذاب}.

الأعظمي 15052صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Hypocrisy and the hypocrites
Section
Among the qualities of the hypocrites is that they love to be praised for what they did not do
Numbering
Jami al-Kamil 15052 (2nd edition)
Azami 15052