Testing forms that update streams

Hello all, i’m having a weird issue when testing forms on a liveview index page that updates the contents of a stream.

Basically, i’m trying to test that the form on that page correctly filters the stream. This form works fine in practice, but in theory (testing) i’m having troubles getting render_submit to change the items on the page as it does when physically everything functions correctly.

So I have a small piece of test code that attempts to test this:

index_live
      |> element("#query-form")
      |> render_submit(%{index: %{pending: true, progress: false, upcoming: false}})

or variations with

index_live
      |> element("#query-form", index: %{pending: true, progress: false, upcoming: false})
      |> render_submit()

and all manner of render(index_live), element("#table") |> render() and friends.

By default the query parameters are pending: true, progress: true, upcoming: true and when I evaluate the parameters and output of the functions that return the new items to be put in the stream, everything is there or not there as expected.

The form should be constraining which items are being shown in the stream, however when asserting on the resulting HTML, we still see items which shouldn’t be there.

Is there some trick to getting render_submit to actually change the resulting html? I’m leaning slightly on the stock generated tests for testing modal forms here, but the only difference is there is no patch or redirect happening before we inspect the html.

How can I see the resulting HTML after non patch or redirect operations, such as assigns passed through handle_event?