Update to new interpolation syntax

Includes a fix to a brittle test that failed due to changes in the
number of linebreaks.
This commit is contained in:
Claudio Ortolina
2024-12-02 23:28:11 +00:00
parent 9448e77e23
commit ccefc6e697
16 changed files with 191 additions and 191 deletions
@@ -30,22 +30,22 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
conn: conn,
collection: collection
} do
{:ok, _stats_live, html} = live(conn, "/")
{:ok, stats_live, html} = live(conn, "/")
assert html =~ collection |> length() |> Integer.to_string()
collection
|> Enum.frequencies_by(& &1.format)
|> Enum.each(fn {format, count} ->
assert html =~ "\n#{count}\n"
assert html =~ "\n#{Record.format_long_label(format)}\n"
assert has_element?(stats_live, "a", to_string(count))
assert has_element?(stats_live, "dt", Record.format_long_label(format))
end)
collection
|> Enum.frequencies_by(& &1.type)
|> Enum.each(fn {type, count} ->
assert html =~ "\n#{count}\n"
assert html =~ "\n#{Record.type_long_label(type)}\n"
assert has_element?(stats_live, "a", to_string(count))
assert has_element?(stats_live, "dt", Record.type_long_label(type))
end)
end