If I cast the chaos mastery spell wich converts all my units in fire-based summoned units and my enemy casts the great unsummon spell (that makes all my summoned units in the selected plane pass a dice roll of Will or be destroyed) but I have some units with the resist magic spell how will that work?

Does the resist magic spell only work for damage in combat, or it does something in this case?