mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 05:58:47 +00:00
✨ 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:
parent
80fc70c211
commit
5913c1bb14
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user