test: account activity request_path + data_accessed render branches
This commit is contained in:
parent
b51759dfdf
commit
5498dc6961
1 changed files with 26 additions and 0 deletions
|
|
@ -173,5 +173,31 @@ defmodule ToweropsWeb.AccountLive.ActivityTest do
|
|||
{:ok, _view, html} = live(conn, ~p"/account/activity")
|
||||
assert html =~ "Monitoring data queried"
|
||||
end
|
||||
|
||||
test "renders request_path when present", %{conn: conn, user: user} do
|
||||
{:ok, _} =
|
||||
Admin.create_audit_log(%{
|
||||
action: "user_profile_updated",
|
||||
superuser_id: user.id,
|
||||
target_user_id: user.id,
|
||||
request_path: "/account/profile/edit"
|
||||
})
|
||||
|
||||
{:ok, _view, html} = live(conn, ~p"/account/activity")
|
||||
assert html =~ "/account/profile/edit"
|
||||
end
|
||||
|
||||
test "renders data_accessed map when present", %{conn: conn, user: user} do
|
||||
{:ok, _} =
|
||||
Admin.create_audit_log(%{
|
||||
action: "user_data_exported",
|
||||
superuser_id: user.id,
|
||||
target_user_id: user.id,
|
||||
data_accessed: %{"profile" => "viewed", "sessions" => "listed"}
|
||||
})
|
||||
|
||||
{:ok, _view, html} = live(conn, ~p"/account/activity")
|
||||
assert html =~ "Data accessed"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue