@jslapp This is how I used to test forms in rasa 1.10 - for Rasa 2 you just need to slightly update this as I commented out in the code (it is not a complete code but I hope it gives you the idea).
@pytest.mark.parametrize(
"slots,expected_events",
[
(
{
"slot1": True,
"slot2": None,
},
[
SlotSet("slot1", None),
],
),
],
)
def test_my_form(
default_dispatcher_collecting,
default_domain_dict,
default_sender_id,
slots,
expected_events,
):
test_action = ActionMyForm() # -> RASA2: change this to ActionMyFormSubmit()
tracker = get_tracker(default_sender_id, slots_dict=slots)
events = test_action.submit(
default_dispatcher_collecting, tracker, default_domain_dict
) ## RASA2: change .submit to .run
assert events == expected_events