Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
It is permissible for a fasting person to taste the food, if necessary, and his fast is still valid so long as he does not deliberately swallow anything of it.
Elaborating on the issue of tasting food while fasting, Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, states:
But if the fasting person forgets and swallows it by mistake, there is no sin on him, and he should complete the fast. This is because the general rule of Shari`ah is that the person who forgets is excused. The Prophet (peace and blessings be upon him) said, “Whoever forgets that he is fasting and eats or drinks something, let him complete his fast, for it is Allah Who has fed him and given him to drink.” (Al-Bukhari and Muslim)
Allah Almighty knows best.