mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 07:59:36 +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!
|
(defn- create-file-thumbnail!
|
||||||
[file-id]
|
[file-id]
|
||||||
(let [storage (::sto/storage th/*system*)
|
(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"
|
:bucket "file-thumbnail"
|
||||||
:content-type "image/png"})]
|
:content-type "image/png"})]
|
||||||
(db/insert! (:app.db/pool th/*system*) :file-thumbnail
|
(db/insert! (:app.db/pool th/*system*) :file-thumbnail
|
||||||
@ -138,10 +138,10 @@
|
|||||||
:project-id (:default-project-id profile)})
|
:project-id (:default-project-id profile)})
|
||||||
pool (:app.db/pool th/*system*)
|
pool (:app.db/pool th/*system*)
|
||||||
storage (::sto/storage 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"
|
:bucket "file-thumbnail"
|
||||||
:content-type "image/png"})
|
:content-type "image/jpeg"})
|
||||||
latest (sto/put-object! storage {::sto/content (sto/content "latest thumbnail")
|
latest (sto/put-object! storage {::sto/content (sto/content (th/tempfile "backend_tests/test_files/sample.png"))
|
||||||
:bucket "file-thumbnail"
|
:bucket "file-thumbnail"
|
||||||
:content-type "image/png"})]
|
:content-type "image/png"})]
|
||||||
(db/insert! pool :file-thumbnail
|
(db/insert! pool :file-thumbnail
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user