Add test for StatusView rendering of Cards when missing descriptions
This commit is contained in:
parent
5e7f4f687e
commit
ccceb41bf3
@ -768,6 +768,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||||||
assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card))
|
assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "a rich media card without descriptions returns the fields with empty strings" do
|
||||||
|
page_url = "https://example.com"
|
||||||
|
|
||||||
|
fields = %{
|
||||||
|
"url" => page_url,
|
||||||
|
"site_name" => "Example site name",
|
||||||
|
"title" => "Example website"
|
||||||
|
}
|
||||||
|
|
||||||
|
{:ok, card} = Card.create(page_url, fields)
|
||||||
|
|
||||||
|
assert match?(
|
||||||
|
%{description: "", image_description: ""},
|
||||||
|
StatusView.render("card.json", card)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
test "a rich media card with all relevant data renders correctly" do
|
test "a rich media card with all relevant data renders correctly" do
|
||||||
page_url = "https://example.com"
|
page_url = "https://example.com"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user