+
+
+
+ <.icon name="hero-users" class="w-5 h-5 mr-2 text-gray-500" />
+ Group Members ({get_user_count(@group)})
+
+
+
-
-
Description
-
- {if @group.description && String.length(@group.description) > 0,
- do: @group.description,
- else: "No description"}
-
+
+
+
+ <.icon name="hero-user-plus" class="w-full h-full" />
+
+
No members yet
+
Invite people to join this group.
+
+
+
+
+
0} class="text-center py-4">
+
Member management coming soon...
+
-
-
Members
-
- {get_user_count(@group)} {if get_user_count(@group) == 1, do: "member", else: "members"}
-
+
+
+
+
+
+
+ <.icon name="hero-clock" class="w-5 h-5 mr-2 text-gray-500" /> Recent Activity
+
-
-
Created
-
{format_date(@group.inserted_at)}
+
+
+
+ <.icon name="hero-document-text" class="w-full h-full" />
+
+
No activity yet
+
+ Activity will appear here as members add expenses.
+
+
-
+
diff --git a/test/split_app_web/live/dashboard_live_test.exs b/test/split_app_web/live/dashboard_live_test.exs
index 326cd6d..3fcd41e 100644
--- a/test/split_app_web/live/dashboard_live_test.exs
+++ b/test/split_app_web/live/dashboard_live_test.exs
@@ -56,18 +56,18 @@ defmodule SplitAppWeb.DashboardLiveTest do
# Wait for the update
:timer.sleep(100)
-
+
# Verify we're still on the dashboard (not redirected)
html = render(live)
assert html =~ "Welcome"
-
+
# Verify expense was created and shows in recent expenses
assert html =~ "Dashboard Expense"
assert html =~ "Test expense from dashboard"
-
+
# Verify modal is closed
refute has_element?(live, "#expense-modal")
-
+
# Verify flash message
assert html =~ "Expense created successfully"
end
@@ -89,7 +89,7 @@ defmodule SplitAppWeb.DashboardLiveTest do
# Verify modal is closed
refute has_element?(live, "#expense-modal")
-
+
# Verify we're still on the dashboard
assert render(live) =~ "Welcome"
assert render(live) =~ "Recent Expenses"
@@ -97,17 +97,19 @@ defmodule SplitAppWeb.DashboardLiveTest do
test "displays existing expenses in recent expenses section", %{conn: conn, user: user} do
# Create some expenses
- expense1 = expense_fixture(%{
- created_by_id: user.id,
- title: "First Expense",
- description: "First Description"
- })
-
- expense2 = expense_fixture(%{
- created_by_id: user.id,
- title: "Second Expense",
- description: "Second Description"
- })
+ expense1 =
+ expense_fixture(%{
+ created_by_id: user.id,
+ title: "First Expense",
+ description: "First Description"
+ })
+
+ expense2 =
+ expense_fixture(%{
+ created_by_id: user.id,
+ title: "Second Expense",
+ description: "Second Description"
+ })
{:ok, _live, html} = live(conn, ~p"/dashboard")
@@ -185,26 +187,28 @@ defmodule SplitAppWeb.DashboardLiveTest do
# Fill and submit form
assert live
- |> form("#group-form", group: %{
- name: "Dashboard Test Group",
- description: "Created from dashboard"
- })
+ |> form("#group-form",
+ group: %{
+ name: "Dashboard Test Group",
+ description: "Created from dashboard"
+ }
+ )
|> render_submit()
# Wait for the update
:timer.sleep(100)
-
+
# Verify we're still on the dashboard (not redirected)
html = render(live)
assert html =~ "Welcome"
-
+
# Verify group was created and shows in groups section
assert html =~ "Dashboard Test Group"
assert html =~ "Created from dashboard"
-
+
# Verify modal is closed
refute has_element?(live, "#group-modal")
-
+
# Verify flash message
assert html =~ "Group created successfully"
end
@@ -225,7 +229,7 @@ defmodule SplitAppWeb.DashboardLiveTest do
# Verify modal is closed
refute has_element?(live, "#group-modal")
-
+
# Verify we're still on the dashboard
assert render(live) =~ "Welcome"
assert render(live) =~ "Your Groups"
@@ -245,4 +249,4 @@ defmodule SplitAppWeb.DashboardLiveTest do
|> render_change() =~ "can't be blank"
end
end
-end
\ No newline at end of file
+end
diff --git a/test/split_app_web/live/group_live_test.exs b/test/split_app_web/live/group_live_test.exs
index 0038909..17a8997 100644
--- a/test/split_app_web/live/group_live_test.exs
+++ b/test/split_app_web/live/group_live_test.exs
@@ -49,7 +49,7 @@ defmodule SplitAppWeb.GroupLiveTest do
test "updates group in listing", %{conn: conn, group: group} do
{:ok, index_live, _html} = live(conn, ~p"/groups")
- assert index_live |> element("a", "Edit") |> render_click() =~
+ assert index_live |> element("a[phx-click='edit_group']") |> render_click() =~
"Edit Group"
assert_patch(index_live, ~p"/groups/#{group}/edit")
@@ -72,8 +72,8 @@ defmodule SplitAppWeb.GroupLiveTest do
test "deletes group in listing", %{conn: conn, group: group} do
{:ok, index_live, _html} = live(conn, ~p"/groups")
- assert index_live |> element("a", "Delete") |> render_click()
- refute has_element?(index_live, "li", group.name)
+ assert index_live |> element("button[phx-click='delete']") |> render_click()
+ refute has_element?(index_live, "div", group.name)
end
end