Skip to content

Commit

Permalink
☔ Update unit tests for latest round of Facebook shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
pmonks committed Nov 12, 2024
1 parent a1b8667 commit a4f14ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unfurl/api_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
; Site with HTML metatags plus (partial) OpenGraph tags
(let [result (tunfurl "http://www.facebook.com/")]
; We do "fuzzy" testing because Facebook's meta tags change frequently enough that testing precise values is painful
(is (s/starts-with? (s/lower-case (:title result)) "facebook"))
(is (true? (s/includes? (s/lower-case (:title result)) "facebook")))
(is (not (s/blank? (:description result))))
(is (= (:url result) "https://www.facebook.com/"))
(is (= (:preview-url result) "https://www.facebook.com/images/fb_icon_325x325.png")))
(is (true? (s/includes? (:url result) "https://www.facebook.com/")))
(is (true? (s/includes? (:preview-url result) "https://www.facebook.com/images/"))))

; Everything and the kitchen sink tags (OpenGraph, Twitter, Swiftype and Sailthru!)
; Commented out as TechCrunch web server's aren't reliable enough to use for unit testing - sometimes they work, sometimes they time out, sometimes they return a corrupted ZLIB stream, ...
Expand Down

0 comments on commit a4f14ca

Please sign in to comment.