Skip to content

Commit 7c59805

Browse files
committed
add test for module name
1 parent 452b739 commit 7c59805

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/live_debugger_web/live/traces/components/trace.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ defmodule LiveDebuggerWeb.Live.Traces.Components.Trace do
9797
def module(assigns) do
9898
~H"""
9999
<div class={["text-primary text-2xs font-normal truncate", @class]}>
100-
<%= @trace.module %>
100+
<%= Parsers.module_to_string(@trace.module) %>
101101
<%= if(@trace.cid, do: "(#{@trace.cid})") %>
102102
</div>
103103
"""

test/live_debugger/process_callback_traces_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ defmodule LiveDebugger.ProcessCallbackTracesTest do
3434
|> assert_has(trace_name(text: "handle_event/3", count: 1))
3535
|> assert_has(trace_name(text: "handle_info/2", count: 1))
3636
|> assert_has(trace_name(text: "render/1", count: 1))
37+
|> assert_has(trace_module(text: "LiveDebuggerDev.LiveViews.Main", count: 2))
38+
|> assert_has(trace_module(text: "LiveDebuggerDev.LiveComponents.Send (4)", count: 1))
3739
|> click(clear_traces_button())
3840
|> assert_has(traces(count: 0))
3941
|> assert_has(no_traces_info())
@@ -54,5 +56,7 @@ defmodule LiveDebugger.ProcessCallbackTracesTest do
5456

5557
defp trace_name(opts), do: css("#global-traces-stream details p.font-medium", opts)
5658

59+
defp trace_module(opts), do: css("#global-traces-stream details div.col-span-3", opts)
60+
5761
defp global_callback_traces_button(), do: css("button[aria-label=\"Icon globe\"]")
5862
end

0 commit comments

Comments
 (0)