Can anyone give me an example of how to test a surface component. I currently have this:
defmodule DoomWeb.Components.CardTest do
use Surface.LiveViewTest
import Phoenix.LiveViewTest
alias DoomWeb.Components.Card
test "creates a <Card> with title and description" do
html =
render_surface do
~F"""
<Card />
"""
end
assert html =~ """
<div></div>
"""
end
end
and the only thing I get is:
== Compilation error in file test/doom_web/components/card_test.exs ==
** (CompileError) test/doom_web/components/card_test.exs:8: undefined function test/2 (there is no such import)
(elixir 1.13.4) lib/kernel/parallel_compiler.ex:455: Kernel.ParallelCompiler.require_file/2
(elixir 1.13.4) lib/kernel/parallel_compiler.ex:348: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
The there is no test/2 ??? Where is that suposte to come from?