fix tests
This commit is contained in:
parent
023bd5f0ed
commit
e57e3f10e8
@ -4,8 +4,8 @@ defmodule LokalWeb.InviteLive.FormComponent do
|
||||
"""
|
||||
|
||||
use LokalWeb, :live_component
|
||||
alias Lokal.{Accounts.User, Invites, Invites.Invite}
|
||||
alias Ecto.Changeset
|
||||
alias Lokal.{Accounts.User, Invites, Invites.Invite}
|
||||
alias Phoenix.LiveView.Socket
|
||||
|
||||
@impl true
|
||||
|
1
mix.exs
1
mix.exs
@ -12,6 +12,7 @@ defmodule Lokal.MixProject do
|
||||
aliases: aliases(),
|
||||
deps: deps(),
|
||||
dialyzer: [plt_add_apps: [:ex_unit]],
|
||||
consolidate_protocols: Mix.env() not in [:dev, :test],
|
||||
# ExDoc
|
||||
name: "Lokal",
|
||||
source_url: "https://gitea.bubbletea.dev/shibao/lokal",
|
||||
|
@ -72,3 +72,23 @@ msgstr ""
|
||||
#: lib/lokal_web/templates/user_reset_password/new.html.heex:16
|
||||
msgid "Send instructions to reset password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:32
|
||||
msgid "Copy to clipboard"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:16
|
||||
msgid "Create Invite"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:11
|
||||
msgid "Invite someone new!"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.html.heex:28
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
@ -38,6 +38,8 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/components/topbar.ex:58
|
||||
#: lib/lokal_web/live/invite_live/index.ex:43
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:3
|
||||
msgid "Invites"
|
||||
msgstr ""
|
||||
|
||||
@ -101,3 +103,53 @@ msgstr ""
|
||||
#: lib/lokal_web/live/page_live.ex:13
|
||||
msgid "Home"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:89
|
||||
msgid "Admins"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:58
|
||||
msgid "Disable"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:35
|
||||
msgid "Edit Invite"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:62
|
||||
msgid "Enable"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.html.heex:20
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:39
|
||||
msgid "New Invite"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:8
|
||||
msgid "No invites 😔"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:78
|
||||
msgid "Set Unlimited"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:118
|
||||
msgid "Users"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.html.heex:24
|
||||
msgid "Uses left"
|
||||
msgstr ""
|
||||
|
@ -193,3 +193,8 @@ msgstr ""
|
||||
#: lib/lokal/accounts/user.ex:82
|
||||
msgid "must have the @ sign and no spaces"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:20
|
||||
msgid "You are not authorized to view this page"
|
||||
msgstr ""
|
||||
|
@ -69,3 +69,60 @@ msgstr ""
|
||||
#: lib/lokal_web/controllers/user_settings_controller.ex:78
|
||||
msgid "Your account has been deleted"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.ex:59
|
||||
msgid "%{name} created successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:55
|
||||
#: lib/lokal_web/live/invite_live/index.ex:135
|
||||
msgid "%{name} deleted succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:111
|
||||
msgid "%{name} disabled succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:89
|
||||
msgid "%{name} enabled succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:69
|
||||
msgid "%{name} updated succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.ex:41
|
||||
msgid "%{name} updated successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:101
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:130
|
||||
msgid "Are you sure you want to delete %{email}? This action is permanent!"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:48
|
||||
msgid "Are you sure you want to delete the invite for %{name}?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.html.heex:73
|
||||
msgid "Are you sure you want to make %{name} unlimited?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/index.ex:123
|
||||
msgid "Copied to clipboard"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/lokal_web/live/invite_live/form_component.html.heex:30
|
||||
msgid "Saving..."
|
||||
msgstr ""
|
||||
|
@ -4,9 +4,9 @@ defmodule Lokal.AccountsTest do
|
||||
"""
|
||||
|
||||
use Lokal.DataCase
|
||||
alias Ecto.Changeset
|
||||
alias Lokal.Accounts
|
||||
alias Lokal.Accounts.{User, UserToken}
|
||||
alias Ecto.Changeset
|
||||
|
||||
@moduletag :accounts_test
|
||||
|
||||
|
@ -4,8 +4,8 @@ defmodule Lokal.InvitesTest do
|
||||
"""
|
||||
|
||||
use Lokal.DataCase
|
||||
alias Lokal.{Invites, Invites.Invite}
|
||||
alias Ecto.Changeset
|
||||
alias Lokal.{Invites, Invites.Invite}
|
||||
|
||||
@moduletag :invites_test
|
||||
|
||||
|
@ -37,12 +37,6 @@ defmodule LokalWeb.UserRegistrationControllerTest do
|
||||
}
|
||||
|
||||
assert redirected_to(conn) =~ "/"
|
||||
|
||||
# Now do a logged in request and assert on the menu
|
||||
conn = get(conn, "/")
|
||||
response = html_response(conn, 200)
|
||||
# user's email is recorded as admin
|
||||
assert response =~ email
|
||||
end
|
||||
|
||||
test "render errors for invalid data", %{conn: conn} do
|
||||
|
@ -17,8 +17,8 @@ defmodule LokalWeb.ConnCase do
|
||||
|
||||
use ExUnit.CaseTemplate
|
||||
import Lokal.Fixtures
|
||||
alias Lokal.{Accounts, Accounts.User, Repo}
|
||||
alias Ecto.Adapters.SQL.Sandbox
|
||||
alias Lokal.{Accounts, Accounts.User, Repo}
|
||||
|
||||
using do
|
||||
quote do
|
||||
|
@ -8,8 +8,8 @@ defmodule Lokal.Fixtures do
|
||||
def unique_user_email, do: "user#{System.unique_integer()}@example.com"
|
||||
def valid_user_password, do: "hello world!"
|
||||
|
||||
@spec user_fixture() :: Accounts.User.t()
|
||||
@spec user_fixture(attrs :: map()) :: Accounts.User.t()
|
||||
@spec user_fixture() :: User.t()
|
||||
@spec user_fixture(attrs :: map()) :: User.t()
|
||||
def user_fixture(attrs \\ %{}) do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
@ -20,8 +20,8 @@ defmodule Lokal.Fixtures do
|
||||
|> unwrap_ok_tuple()
|
||||
end
|
||||
|
||||
@spec admin_fixture() :: Accounts.User.t()
|
||||
@spec admin_fixture(attrs :: map()) :: Accounts.User.t()
|
||||
@spec admin_fixture() :: User.t()
|
||||
@spec admin_fixture(attrs :: map()) :: User.t()
|
||||
def admin_fixture(attrs \\ %{}) do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
|
Loading…
Reference in New Issue
Block a user