diff --git a/test/towerops_web/live/account_live/activity_test.exs b/test/towerops_web/live/account_live/activity_test.exs index b8789667..2810bc8b 100644 --- a/test/towerops_web/live/account_live/activity_test.exs +++ b/test/towerops_web/live/account_live/activity_test.exs @@ -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