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