From 705fd665d263ea56a0673d92c9e55c27266c5d22 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 14 Sep 2024 14:19:45 +0100 Subject: [PATCH] Formatter pass --- lib/music_library/application.ex | 3 +-- .../live/record_live/index.html.heex | 7 ++++++- .../live/record_live/show.html.heex | 7 ++++++- .../controllers/error_html_test.exs | 3 ++- .../live/record_live_test.exs | 18 ++++++++++++++++-- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/music_library/application.ex b/lib/music_library/application.ex index d5045728..1947edf7 100644 --- a/lib/music_library/application.ex +++ b/lib/music_library/application.ex @@ -11,8 +11,7 @@ defmodule MusicLibrary.Application do MusicLibraryWeb.Telemetry, MusicLibrary.Repo, {Ecto.Migrator, - repos: Application.fetch_env!(:music_library, :ecto_repos), - skip: skip_migrations?()}, + repos: Application.fetch_env!(:music_library, :ecto_repos), skip: skip_migrations?()}, {DNSCluster, query: Application.get_env(:music_library, :dns_cluster_query) || :ignore}, {Phoenix.PubSub, name: MusicLibrary.PubSub}, # Start a worker by calling: MusicLibrary.Worker.start_link(arg) diff --git a/lib/music_library_web/live/record_live/index.html.heex b/lib/music_library_web/live/record_live/index.html.heex index 17fadfed..128aa271 100644 --- a/lib/music_library_web/live/record_live/index.html.heex +++ b/lib/music_library_web/live/record_live/index.html.heex @@ -34,7 +34,12 @@ -<.modal :if={@live_action in [:new, :edit]} id="record-modal" show on_cancel={JS.patch(~p"/records")}> +<.modal + :if={@live_action in [:new, :edit]} + id="record-modal" + show + on_cancel={JS.patch(~p"/records")} +> <.live_component module={MusicLibraryWeb.RecordLive.FormComponent} id={@record.id || :new} diff --git a/lib/music_library_web/live/record_live/show.html.heex b/lib/music_library_web/live/record_live/show.html.heex index 481f198b..e33507b7 100644 --- a/lib/music_library_web/live/record_live/show.html.heex +++ b/lib/music_library_web/live/record_live/show.html.heex @@ -19,7 +19,12 @@ <.back navigate={~p"/records"}>Back to records -<.modal :if={@live_action == :edit} id="record-modal" show on_cancel={JS.patch(~p"/records/#{@record}")}> +<.modal + :if={@live_action == :edit} + id="record-modal" + show + on_cancel={JS.patch(~p"/records/#{@record}")} +> <.live_component module={MusicLibraryWeb.RecordLive.FormComponent} id={@record.id} diff --git a/test/music_library_web/controllers/error_html_test.exs b/test/music_library_web/controllers/error_html_test.exs index 9be0c01d..fffedf38 100644 --- a/test/music_library_web/controllers/error_html_test.exs +++ b/test/music_library_web/controllers/error_html_test.exs @@ -9,6 +9,7 @@ defmodule MusicLibraryWeb.ErrorHTMLTest do end test "renders 500.html" do - assert render_to_string(MusicLibraryWeb.ErrorHTML, "500", "html", []) == "Internal Server Error" + assert render_to_string(MusicLibraryWeb.ErrorHTML, "500", "html", []) == + "Internal Server Error" end end diff --git a/test/music_library_web/live/record_live_test.exs b/test/music_library_web/live/record_live_test.exs index fe2d8a15..357a010c 100644 --- a/test/music_library_web/live/record_live_test.exs +++ b/test/music_library_web/live/record_live_test.exs @@ -4,8 +4,22 @@ defmodule MusicLibraryWeb.RecordLiveTest do import Phoenix.LiveViewTest import MusicLibrary.RecordsFixtures - @create_attrs %{type: :album, title: "some title", image: "some image", year: 42, musicbrainz_id: "7488a646-e31f-11e4-aace-600308960662", genres: ["option1", "option2"]} - @update_attrs %{type: :ep, title: "some updated title", image: "some updated image", year: 43, musicbrainz_id: "7488a646-e31f-11e4-aace-600308960668", genres: ["option1"]} + @create_attrs %{ + type: :album, + title: "some title", + image: "some image", + year: 42, + musicbrainz_id: "7488a646-e31f-11e4-aace-600308960662", + genres: ["option1", "option2"] + } + @update_attrs %{ + type: :ep, + title: "some updated title", + image: "some updated image", + year: 43, + musicbrainz_id: "7488a646-e31f-11e4-aace-600308960668", + genres: ["option1"] + } @invalid_attrs %{type: nil, title: nil, image: nil, year: nil, musicbrainz_id: nil, genres: []} defp create_record(_) do