From 9b314a9806d7073c50fe3ef4d5710b4673d94f6c Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 29 Jan 2026 15:26:45 +0100 Subject: [PATCH] fix: credo error --- test/mv_web/live/group_live/index_test.exs | 8 -------- test/mv_web/live/group_live/show_test.exs | 5 ----- test/mv_web/user_live/index_test.exs | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/test/mv_web/live/group_live/index_test.exs b/test/mv_web/live/group_live/index_test.exs index 5e15cbc..b972095 100644 --- a/test/mv_web/live/group_live/index_test.exs +++ b/test/mv_web/live/group_live/index_test.exs @@ -139,9 +139,6 @@ defmodule MvWeb.GroupLive.IndexTest do # Verify all groups are displayed assert html =~ gettext("Groups") - # Log actual query count for monitoring - IO.puts("\n[PERF] GroupLive.Index 'page loads efficiently': #{final_count} 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 # Allow overhead for authorization, LiveView setup, and other initialization queries @@ -183,11 +180,6 @@ defmodule MvWeb.GroupLive.IndexTest do # Member count should be displayed (should be 2) assert html =~ "2" or html =~ gettext("Members") or html =~ "Mitglieder" - # Log actual query count for monitoring - IO.puts( - "\n[PERF] GroupLive.Index 'member count is loaded efficiently': #{final_count} queries" - ) - # 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 # Allow overhead for authorization, LiveView setup, and other initialization queries diff --git a/test/mv_web/live/group_live/show_test.exs b/test/mv_web/live/group_live/show_test.exs index 1dfe9a0..bef234b 100644 --- a/test/mv_web/live/group_live/show_test.exs +++ b/test/mv_web/live/group_live/show_test.exs @@ -256,11 +256,6 @@ defmodule MvWeb.GroupLive.ShowTest do assert html =~ member.first_name or html =~ member.last_name end) - # Log actual query count for monitoring - IO.puts( - "\n[PERF] GroupLive.Show 'member list is loaded efficiently': #{final_count} queries" - ) - # Verify query count is reasonable (should avoid N+1 queries) # Expected: 1 query for group lookup + 1 query for members (with preload) + member_count aggregate # Allow overhead for authorization, LiveView setup, and other initialization queries diff --git a/test/mv_web/user_live/index_test.exs b/test/mv_web/user_live/index_test.exs index ce9da6f..6dbbe3d 100644 --- a/test/mv_web/user_live/index_test.exs +++ b/test/mv_web/user_live/index_test.exs @@ -244,7 +244,7 @@ defmodule MvWeb.UserLive.IndexTest do |> Enum.uniq() # Skip if no users found (shouldn't happen, but be safe) - if length(user_ids) > 0 do + if user_ids != [] do # Initially nothing should be checked refute view |> element("input[type='checkbox'][name='select_all'][checked]")