Twittercard metadata for images should also include dimensions if available
[akkoma] / test / pleroma / web / metadata / providers / twitter_card_test.exs
index 196bca20a254629c8bf12937cb220783a4a7452d..dbb15b79f4bb83791fc0978a8e61689735931287 100644 (file)
@@ -111,7 +111,14 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
           "content" => "pleroma in a nutshell",
           "attachment" => [
             %{
-              "url" => [%{"mediaType" => "image/png", "href" => "https://pleroma.gov/tenshi.png"}]
+              "url" => [
+                %{
+                  "mediaType" => "image/png",
+                  "href" => "https://pleroma.gov/tenshi.png",
+                  "height" => 1024,
+                  "width" => 1280
+                }
+              ]
             },
             %{
               "url" => [
@@ -123,7 +130,12 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
             },
             %{
               "url" => [
-                %{"mediaType" => "video/webm", "href" => "https://pleroma.gov/about/juche.webm"}
+                %{
+                  "mediaType" => "video/webm",
+                  "href" => "https://pleroma.gov/about/juche.webm",
+                  "height" => 600,
+                  "width" => 800
+                }
               ]
             }
           ]
@@ -137,14 +149,16 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
              {:meta, [property: "twitter:description", content: "pleroma in a nutshell"], []},
              {:meta, [property: "twitter:card", content: "summary_large_image"], []},
              {:meta, [property: "twitter:player", content: "https://pleroma.gov/tenshi.png"], []},
+             {:meta, [property: "twitter:player:width", content: "1280"], []},
+             {:meta, [property: "twitter:player:height", content: "1024"], []},
              {:meta, [property: "twitter:card", content: "player"], []},
              {:meta,
               [
                 property: "twitter:player",
                 content: Router.Helpers.o_status_url(Endpoint, :notice_player, activity.id)
               ], []},
-             {:meta, [property: "twitter:player:width", content: "480"], []},
-             {:meta, [property: "twitter:player:height", content: "480"], []},
+             {:meta, [property: "twitter:player:width", content: "800"], []},
+             {:meta, [property: "twitter:player:height", content: "600"], []},
              {:meta,
               [
                 property: "twitter:player:stream",