Use real image fixtures in link-preview thumbnail tests

Store genuine PNG/JPEG bytes via th/tempfile instead of placeholder strings, so the file-thumbnail objects under test carry realistic content and content-types.

AI-assisted-by: muse-spark-1.3-contributor
This commit is contained in:
Andrey Antukh 2026-09-09 18:32:25 +00:00
parent 80fc70c211
commit 5913c1bb14

View File

@ -33,7 +33,7 @@
(defn- create-file-thumbnail!
[file-id]
(let [storage (::sto/storage th/*system*)
object (sto/put-object! storage {::sto/content (sto/content "thumbnail data")
object (sto/put-object! storage {::sto/content (sto/content (th/tempfile "backend_tests/test_files/sample.png"))
:bucket "file-thumbnail"
:content-type "image/png"})]
(db/insert! (:app.db/pool th/*system*) :file-thumbnail
@ -138,10 +138,10 @@
:project-id (:default-project-id profile)})
pool (:app.db/pool th/*system*)
storage (::sto/storage th/*system*)
old (sto/put-object! storage {::sto/content (sto/content "old thumbnail")
old (sto/put-object! storage {::sto/content (sto/content (th/tempfile "backend_tests/test_files/sample.jpg"))
:bucket "file-thumbnail"
:content-type "image/png"})
latest (sto/put-object! storage {::sto/content (sto/content "latest thumbnail")
:content-type "image/jpeg"})
latest (sto/put-object! storage {::sto/content (sto/content (th/tempfile "backend_tests/test_files/sample.png"))
:bucket "file-thumbnail"
:content-type "image/png"})]
(db/insert! pool :file-thumbnail