How do I write test cases for this

I want to write test cases for this plz help me with this

defmodule Landscape do
  @moduledoc false
  use Surface.LiveComponent



  def render(assigns) do
    ~H"""
    <div>
      <div>Message Board</div>
      <div>
        <span><img class="poi-wrapper" src="sample.png" > Sample</span>
      </div>
    </div>
    """
  end
end

A good place to start when writing tests is to ask yourself, “how can this code fail?”

This code doesn’t do anything other than render a ~H template containing only static text. Is there anything to test?

6 Likes

noted with thanks

Test that if you hit the endpoint, with a real http request it gives you back something with the expected “Message Board”

Edit: oh, it’s a live component.