revert 08c32dce7b
Some checks reported errors
continuous-integration/drone/push Build was killed

revert fix: failing tests from full suite
This commit is contained in:
simon 2026-03-13 19:23:59 +01:00
parent 08c32dce7b
commit 81fb794c76
5 changed files with 11 additions and 14 deletions

View file

@ -58,7 +58,3 @@ config :mv, :sql_sandbox, true
# Join form rate limit: low limit so tests can trigger rate limiting (e.g. 2 per minute) # Join form rate limit: low limit so tests can trigger rate limiting (e.g. 2 per minute)
config :mv, :join_rate_limit, scale_ms: 60_000, limit: 2 config :mv, :join_rate_limit, scale_ms: 60_000, limit: 2
# Ash: silence "after_transaction hooks in surrounding transaction" warning when using
# Ecto sandbox (tests run in a transaction; create_member after_transaction is expected).
config :ash, warn_on_transaction_hooks?: false

View file

@ -56,7 +56,7 @@ defmodule Mv.Membership.SettingJoinFormTest do
Membership.update_settings(settings, attrs) Membership.update_settings(settings, attrs)
end end
defp _error_message(errors, field) when is_atom(field) do defp error_message(errors, field) when is_atom(field) do
errors errors
|> Enum.filter(fn err -> Map.get(err, :field) == field end) |> Enum.filter(fn err -> Map.get(err, :field) == field end)
|> Enum.map(&Map.get(&1, :message, "")) |> Enum.map(&Map.get(&1, :message, ""))

View file

@ -144,8 +144,8 @@ defmodule MvWeb.GroupLive.IndexTest do
# Verify query count is reasonable (should avoid N+1 queries) # Verify query count is reasonable (should avoid N+1 queries)
# Expected: 1 query for groups list + 1 batch query for member counts + LiveView setup queries # Expected: 1 query for groups list + 1 batch query for member counts + LiveView setup queries
# Allow overhead for authorization, LiveView setup, and other initialization queries # Allow overhead for authorization, LiveView setup, and other initialization queries
assert final_count <= 13, assert final_count <= 12,
"Expected max 13 queries (groups list + batch member counts + LiveView setup + auth), got #{final_count}. This suggests N+1 query problem." "Expected max 12 queries (groups list + batch member counts + LiveView setup + auth), got #{final_count}. This suggests N+1 query problem."
end end
test "member count is loaded efficiently via calculation", %{conn: conn} do test "member count is loaded efficiently via calculation", %{conn: conn} do
@ -185,8 +185,8 @@ defmodule MvWeb.GroupLive.IndexTest do
# Verify query count is reasonable (member count should be calculated efficiently) # Verify query count is reasonable (member count should be calculated efficiently)
# Expected: 1 query for groups + 1 batch query for member counts + LiveView setup queries # Expected: 1 query for groups + 1 batch query for member counts + LiveView setup queries
# Allow overhead for authorization, LiveView setup, and other initialization queries # Allow overhead for authorization, LiveView setup, and other initialization queries
assert final_count <= 13, assert final_count <= 12,
"Expected max 13 queries (groups + batch member counts + LiveView setup + auth), got #{final_count}. This suggests inefficient member count calculation." "Expected max 12 queries (groups + batch member counts + LiveView setup + auth), got #{final_count}. This suggests inefficient member count calculation."
end end
end end
end end

View file

@ -253,8 +253,8 @@ defmodule MvWeb.GroupLive.ShowTest do
# Verify query count is reasonable (should avoid N+1 queries). # Verify query count is reasonable (should avoid N+1 queries).
# Baseline: group + members preload + member_count aggregate + 1 layout get_settings + auth/role/join-count. # Baseline: group + members preload + member_count aggregate + 1 layout get_settings + auth/role/join-count.
assert final_count <= 23, assert final_count <= 22,
"Expected max 23 queries (group + members preload + member_count + layout + auth), got #{final_count}. This suggests N+1 query problem." "Expected max 22 queries (group + members preload + member_count + layout + auth), got #{final_count}. This suggests N+1 query problem."
end end
test "slug lookup is efficient (uses unique_slug index)", %{conn: conn} do test "slug lookup is efficient (uses unique_slug index)", %{conn: conn} do

View file

@ -24,15 +24,16 @@ defmodule MvWeb.UserLive.IndexTest do
@tag :ui @tag :ui
test "shows translated titles in different locales", %{conn: conn} do test "shows translated titles in different locales", %{conn: conn} do
# Page title/heading uses sidebar label (Users / Benutzer*innen), not "Listing Users" # Test German translation
conn = conn_with_oidc_user(conn) conn = conn_with_oidc_user(conn)
conn = Plug.Test.init_test_session(conn, locale: "de") conn = Plug.Test.init_test_session(conn, locale: "de")
{:ok, _view, html_de} = live(conn, "/users") {:ok, _view, html_de} = live(conn, "/users")
assert html_de =~ "Benutzer*innen" assert html_de =~ "Benutzer*innen auflisten"
# Test English translation
conn = Plug.Test.init_test_session(conn, locale: "en") conn = Plug.Test.init_test_session(conn, locale: "en")
{:ok, _view, html_en} = live(conn, "/users") {:ok, _view, html_en} = live(conn, "/users")
assert html_en =~ "Users" assert html_en =~ "Listing Users"
end end
end end