commit: 1c4c73c6a0c95ecb75d4048f52bedc511f0d4b66
parent 8443f82247d8e0a76009c9b4f337d2aec5b8aa5c
Author: Mark Felder <feld@feld.me>
Date:   Tue,  8 Jun 2021 14:02:56 -0500
Add test for AnalyzeMetadata upload filter fetching dimensions from a video
Diffstat:
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/test/fixtures/video.mp4 b/test/fixtures/video.mp4
Binary files differ.
diff --git a/test/pleroma/upload/filter/analyze_metadata_test.exs b/test/pleroma/upload/filter/analyze_metadata_test.exs
@@ -16,4 +16,15 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do
 
     assert {:ok, :filtered, %{width: 1024, height: 768}} = AnalyzeMetadata.filter(upload)
   end
+
+  test "adds the video dimensions" do
+    upload = %Pleroma.Upload{
+      name: "coolvideo.mp4",
+      content_type: "video/mp4",
+      path: Path.absname("test/fixtures/video.mp4"),
+      tempfile: Path.absname("test/fixtures/video.mp4")
+    }
+
+    assert {:ok, :filtered, %{width: 480, height: 480}} = AnalyzeMetadata.filter(upload)
+  end
 end