defmodule MvWeb.StatisticsLiveTest do @moduledoc """ Tests for the Statistics LiveView at /statistics. """ use MvWeb.ConnCase, async: true import Phoenix.LiveViewTest describe "statistics page" do test "renders statistics page with title and key labels for authenticated user with access", %{ conn: conn } do {:ok, _view, html} = live(conn, ~p"/statistics") assert html =~ "Statistics" assert html =~ "Active members" assert html =~ "Unpaid" assert html =~ "Contributions by year" assert html =~ "Member numbers by year" end test "page shows overview of all relevant years without year selector", %{conn: conn} do {:ok, _view, html} = live(conn, ~p"/statistics") # No year dropdown: single select for year should not be present as main control assert html =~ "Overview" or html =~ "overview" # table header or legend assert html =~ "Year" end end end