diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/microformats/parser_test.clj | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj index a28261e..26cb094 100644 --- a/test/microformats/parser_test.clj +++ b/test/microformats/parser_test.clj @@ -36,3 +36,24 @@ {:items [{:properties {:name ""}}] :rels {}} "<div class=\"h-card\"><hr class=\"p-name\"/></div>"))) + +(deftest parse-u-elements + (testing "Tags should have their values parsed as a u-* value" + (are [ex in] (= ex (parse in)) + {:items [{:properties {:url "http://example.com"}}] :rels {}} + "<div class=\"h-card\"><a class=\"u-url\" href=\"http://example.com\">Awesome example website</a></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><img class=\"u-photo\" src=\"http://example.com/someimage.png\"></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<map class=\"h-card\"><area class=\"u-photo\" href=\"http://example.com/someimage.png\"></area></map>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><object class=\"u-photo\" data=\"http://example.com/someimage.png\"></object></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><abbr class=\"u-photo\" title=\"http://example.com/someimage.png\"></abbr></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><data class=\"u-photo\" value=\"http://example.com/someimage.png\"></data></div>"))) |