From 329c2e5530cb8a9cddb83f0d2e39ca792a13ed43 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Tue, 20 Feb 2024 09:26:38 -0800 Subject: [PATCH] Finished basic onboarding flow; added tests --- lib/pinchflat/media.ex | 1 - lib/pinchflat/media_source.ex | 5 -- lib/pinchflat/profiles.ex | 5 -- .../layouts/partials/header.html.heex | 4 +- .../layouts/partials/sidebar.html.heex | 6 ++- .../components/layouts/root.html.heex | 2 +- .../media_profile_controller.ex | 12 +++-- .../media_profile_html/new.html.heex | 2 +- .../media_sources/source_controller.ex | 15 ++++-- .../media_sources/source_html/new.html.heex | 2 +- .../controllers/pages/page_controller.ex | 42 ++++++++++------ .../pages/page_html/home.html.heex | 9 +++- test/pinchflat/media_test.exs | 12 +++++ .../media_profile_controller_test.exs | 27 ++++++++++ .../controllers/page_controller_test.exs | 50 +++++++++++++++++-- .../controllers/source_controller_test.exs | 29 +++++++++++ test/support/conn_case.ex | 6 ++- 17 files changed, 183 insertions(+), 46 deletions(-) diff --git a/lib/pinchflat/media.ex b/lib/pinchflat/media.ex index 100884c..0eb996a 100644 --- a/lib/pinchflat/media.ex +++ b/lib/pinchflat/media.ex @@ -100,7 +100,6 @@ defmodule Pinchflat.Media do field -> List.wrap(mapped_struct[field]) end) |> List.flatten() - # TODO: test |> Enum.filter(&is_binary/1) end diff --git a/lib/pinchflat/media_source.ex b/lib/pinchflat/media_source.ex index 1bdb0a4..46fab79 100644 --- a/lib/pinchflat/media_source.ex +++ b/lib/pinchflat/media_source.ex @@ -11,11 +11,6 @@ defmodule Pinchflat.MediaSource do alias Pinchflat.MediaSource.Source alias Pinchflat.MediaClient.SourceDetails - # TODO: test - def sources_exist? do - Repo.exists?(Source) - end - @doc """ Returns the list of sources. Returns [%Source{}, ...] """ diff --git a/lib/pinchflat/profiles.ex b/lib/pinchflat/profiles.ex index ed6b372..01d78b4 100644 --- a/lib/pinchflat/profiles.ex +++ b/lib/pinchflat/profiles.ex @@ -8,11 +8,6 @@ defmodule Pinchflat.Profiles do alias Pinchflat.Profiles.MediaProfile - # TODO: test - def media_profiles_exist? do - Repo.exists?(MediaProfile) - end - @doc """ Returns the list of media_profiles. Returns [%MediaProfile{}, ...] """ diff --git a/lib/pinchflat_web/components/layouts/partials/header.html.heex b/lib/pinchflat_web/components/layouts/partials/header.html.heex index 056d30b..3140ce9 100644 --- a/lib/pinchflat_web/components/layouts/partials/header.html.heex +++ b/lib/pinchflat_web/components/layouts/partials/header.html.heex @@ -7,7 +7,7 @@ > <.icon name="hero-bars-3" /> - @@ -22,7 +22,7 @@ name="q" value={@params["q"]} placeholder="Type to search..." - class="w-full bg-transparent pl-9 pr-4 border-0 focus:ring-0 focus:outline-none xl:w-125" + class="w-full bg-transparent pl-9 pr-4 border-0 focus:ring-0 focus:outline-none lg:w-125" /> diff --git a/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex b/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex index 5b7fe3c..43cc94c 100644 --- a/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex +++ b/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex @@ -4,7 +4,9 @@ @click.outside="sidebarToggle = false" >
-

Pinchflat

+ +

Pinchflat

+