mitgliederverwaltung/test/mv_web/live/member_live/index/cookie_test.exs
Simon 77fc11a0b0 refactor(member-live): modularize the overview and drop the superseded in-memory paths
Extract the cookie parser, export-payload builder and fee-status helper
into their own modules and remove the filter/sort/load helpers the
database pushdown made dead, so the overview LiveView stays a thin
coordinator over focused units.
2026-07-06 11:00:29 +02:00

22 lines
700 B
Elixir

defmodule MvWeb.MemberLive.Index.CookieTest do
@moduledoc """
Tests for the shared cookie-header parser used by the overview persistence chain.
"""
use ExUnit.Case, async: true
alias MvWeb.MemberLive.Index.Cookie
describe "parse_header/1" do
test "splits pairs and URL-decodes values" do
assert Cookie.parse_header("a=1; b=hello%20world") == %{"a" => "1", "b" => "hello world"}
end
test "maps a valueless entry to an empty string" do
assert Cookie.parse_header("flag; a=1") == %{"flag" => "", "a" => "1"}
end
test "keeps only the first '=' as the separator" do
assert Cookie.parse_header("token=a=b=c") == %{"token" => "a=b=c"}
end
end
end