From 1e1eb7786e4097b7b8d385e7364c87a8571fdd92 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 28 May 2024 18:20:20 +0200 Subject: [PATCH] Fix test --- src/main/dda/masto_embed/to_html.cljs | 6 +++--- src/test/dda/masto_embed/data_helpers.cljs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/dda/masto_embed/to_html.cljs b/src/main/dda/masto_embed/to_html.cljs index bc596e7..9571913 100644 --- a/src/main/dda/masto_embed/to_html.cljs +++ b/src/main/dda/masto_embed/to_html.cljs @@ -65,8 +65,8 @@ (defn insert-into-post [item index insertion-element] (let [condition (if (vector? item) - (every? true? [(= (first item) :section) - (= (:class (second item)) "mastodon-post-content")]) + (every? true? [(= (first item) :article) + (= (:class (second item)) "mastodon-post")]) false)] (if condition (insert item index insertion-element) @@ -79,7 +79,7 @@ html)) (defn insert-link-prev [html] - (postwalk #(insert-into-post % 3 link_preview) html)) + (postwalk #(insert-into-post % 4 link_preview) html)) (defn masto-link-prev->html [html card] (let [{:keys [url image title description]} card] diff --git a/src/test/dda/masto_embed/data_helpers.cljs b/src/test/dda/masto_embed/data_helpers.cljs index dcfa593..f221d7b 100644 --- a/src/test/dda/masto_embed/data_helpers.cljs +++ b/src/test/dda/masto_embed/data_helpers.cljs @@ -127,7 +127,9 @@ [:section {:class "mastodon-post-content"} [:p {:class "mastodon-post-text"} "POST_TEXT"] - [:img {:class "mastodon-post-image", :src "POST_IMG_URL"}]] + [:img + {:class "mastodon-post-image", + :src "https://cdn.masto.host/socialmeissagmbhde/media_attachments/files/112/432/505/467/393/505/small/0d01ddb07440328e.jpg"}]] [:footer {:class "mastodon-post-footer"} [:button