Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test coverage Fotohaecker.Content.UploadPhoto #143

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions test/fotohaecker/content/upload_photo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,33 @@ defmodule Fotohaecker.UploadPhotoTest do
alias Fotohaecker.Content.UploadPhoto
import UploadPhoto
doctest Fotohaecker.Content.UploadPhoto

# FIXME: right now, this function is not testable
# because it uses Phoenix.LiveView.consume_uploaded_entries/3 which
# is not available in the test environment
# describe "validate_and_upload_photo/3" do
# test "works with valid photo" do
# submission_params = %{
# title: "a title",
# file_name: "file_name",
# extension: ".jpg",
# user_id: "auth0|123",
# tags: []
# }

# socket = %Phoenix.LiveView.Socket{}
# dest = "dest.jpg"

# actual =
# validate_and_upload_photo(
# submission_params,
# socket,
# dest
# )

# expected = {:ok, "dest.jpg"}

# assert actual == expected
# end
# end
end
Loading