diff --git a/elixir/apps/web/lib/web/live/groups/show.ex b/elixir/apps/web/lib/web/live/groups/show.ex index 412a92169..b52ad2bbc 100644 --- a/elixir/apps/web/lib/web/live/groups/show.ex +++ b/elixir/apps/web/lib/web/live/groups/show.ex @@ -101,7 +101,7 @@ defmodule Web.Groups.Show do - <.danger_zone :if={is_nil(@group.deleted_at)}> + <.danger_zone :if={is_nil(@group.deleted_at) and not Actors.group_synced?(@group)}> <:action> <.delete_button phx-click="delete" diff --git a/elixir/apps/web/test/web/live/groups/show_test.exs b/elixir/apps/web/test/web/live/groups/show_test.exs index 88d4cbbd2..fd0181424 100644 --- a/elixir/apps/web/test/web/live/groups/show_test.exs +++ b/elixir/apps/web/test/web/live/groups/show_test.exs @@ -202,7 +202,7 @@ defmodule Web.Live.Groups.ShowTest do {:error, {:live_redirect, %{to: ~p"/#{account}/groups/#{group}/edit", kind: :push}}} end - test "does not allow editing synced groups", %{ + test "does not allow editing or deleting synced groups", %{ account: account, group: group, identity: identity, @@ -219,12 +219,14 @@ defmodule Web.Live.Groups.ShowTest do ) |> Repo.update!() - {:ok, lv, _html} = + {:ok, lv, html} = conn |> authorize_conn(identity) |> live(~p"/#{account}/groups/#{group}") refute has_element?(lv, "a", "Edit Group") + refute has_element?(lv, "a", "Delete Group") + refute html =~ "Danger Zone" end test "allows editing actors", %{