wa alaykum salam wa rahmatuLlahi wa barakatuHu,
Imam Nawawi mentioned that a marriage, divorce, and financial contracts are all effectuated when done in jest. (Rawdat al-Talibin 8/54) However, there are various integrals and conditions that must be present to effectuate a marriage contract. For example, it is necessary that a woman's guardian marry her off. A marriage in which a woman married herself off is invalid.
And Allah knows best.
Answered by Shaykh Yaqub Abdurrahman