Onboarding improvements (#76)
* Disabled pro modal during onboarding * Restructured the way onboarding changes settings * Added better upload date template placeholder
This commit is contained in:
@@ -1,51 +1,31 @@
|
||||
defmodule PinchflatWeb.PageControllerTest do
|
||||
use PinchflatWeb.ConnCase
|
||||
|
||||
import Pinchflat.ProfilesFixtures
|
||||
import Pinchflat.SourcesFixtures
|
||||
|
||||
alias Pinchflat.Settings
|
||||
|
||||
describe "GET / when testing onboarding" do
|
||||
test "sets the onboarding session to true when onboarding", %{conn: conn} do
|
||||
test "sets the onboarding setting to true when onboarding", %{conn: conn} do
|
||||
_conn = get(conn, ~p"/")
|
||||
assert Settings.get!(:onboarding)
|
||||
end
|
||||
|
||||
test "displays the onboarding page when no media profiles exist", %{conn: conn} do
|
||||
conn = get(conn, ~p"/")
|
||||
assert html_response(conn, 200) =~ "Welcome to Pinchflat"
|
||||
end
|
||||
|
||||
test "displays the onboarding page when no sources exist", %{conn: conn} do
|
||||
_ = media_profile_fixture()
|
||||
|
||||
conn = get(conn, ~p"/")
|
||||
assert html_response(conn, 200) =~ "Welcome to Pinchflat"
|
||||
end
|
||||
|
||||
test "displays the onboarding page when onboarding is forced", %{conn: conn} do
|
||||
_ = media_profile_fixture()
|
||||
_ = source_fixture()
|
||||
Settings.set!(:onboarding, false)
|
||||
|
||||
conn = get(conn, ~p"/?onboarding=1")
|
||||
assert html_response(conn, 200) =~ "Welcome to Pinchflat"
|
||||
end
|
||||
|
||||
test "sets the onboarding session to false when not onboarding", %{conn: conn} do
|
||||
test "sets the onboarding setting to false if you pass the corrent query param", %{conn: conn} do
|
||||
conn = get(conn, ~p"/")
|
||||
assert Settings.get!(:onboarding)
|
||||
|
||||
_ = media_profile_fixture()
|
||||
_ = source_fixture()
|
||||
|
||||
_conn = get(conn, ~p"/")
|
||||
_conn = get(conn, ~p"/?onboarding=0")
|
||||
refute Settings.get!(:onboarding)
|
||||
end
|
||||
|
||||
test "displays the home page when not onboarding", %{conn: conn} do
|
||||
_ = media_profile_fixture()
|
||||
_ = source_fixture()
|
||||
Settings.set!(:onboarding, false)
|
||||
|
||||
conn = get(conn, ~p"/")
|
||||
assert html_response(conn, 200) =~ "MENU"
|
||||
|
||||
Reference in New Issue
Block a user