LiveViewTest: How to test a form with "normal" fields and a file upload

Hey,

i´ve a form with a text field and file upload:

Now i want to test the entire form with its logic, but form and file_input functions of the LiveViewTest Module only return events.

Test extract:

      pre_model_update_view
      |> form("#model-upload-form",
        model: model_params
      )
    # |> file_input("#model-upload-form", :uploaded_files, [
    #   %{
    #     last_modified: 1_594_171_879_000,
    #     name: test_if_file_name,
    #     content: test_ifc_file_content,
    #     size: test_ifc_file_stats.size,
    #     type: "application/ifc"
    #   }
    # ])
    # |> render_submit()
    # |> render_upload(test_if_file_name)

How can i test the entire form?

Thx

have you tried uploading first and then submitting the form?

file_input = file_input(pre_model_update_view, "#model-upload-form", :uploaded_files, [ ... ])

render_upload(file_input, test_if_file_name)

pre_model_update_view
|> form("#model-upload-form", model: model_params)
|> render_submit()

I guess its working, but i´ve work on my current logic.
Thx.

After fixing my logic, i can confirm your solution @trisolaran is correct.