about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAlan Pearce2014-09-11 18:10:03 +0100
committerAlan Pearce2014-09-11 18:10:03 +0100
commit90d4ef777d61af7ad1990e9b3a65e42f591ed1ce (patch)
treedd27da695ddc74919cc69bf84d82d6531890b62b /test
parent31ad04a4ed9bfafa6c9682c9bdd98aadb45f6092 (diff)
downloadmicroformats-90d4ef777d61af7ad1990e9b3a65e42f591ed1ce.tar.lz
microformats-90d4ef777d61af7ad1990e9b3a65e42f591ed1ce.tar.zst
microformats-90d4ef777d61af7ad1990e9b3a65e42f591ed1ce.zip
Get correct property value for special tags
img, area, abbr, data and input tags are all consumed differently.
Diffstat (limited to 'test')
-rw-r--r--test/microformats/parser_test.clj13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj
index f37906e..d9942f4 100644
--- a/test/microformats/parser_test.clj
+++ b/test/microformats/parser_test.clj
@@ -16,3 +16,16 @@
        {:items [{:properties {:nickname "exuser"}}] :rels {}}
        "<div class=\"h-card\"><p class=\"p-nickname\">exuser</p></div>"
        ))
+
+(deftest parse-p-special-elements
+  (testing "img, abbr and data elements should be parsed differently"
+    (are [ex in] (= ex (parse in))
+         {:items [{:properties {:name "Example User"}}] :rels {}}
+         "<div class=\"h-card\"><img class=\"p-name\" alt=\"Example User\"></div>"
+
+         {:items [{:properties {:name "Example User"}}] :rels {}}
+         "<div class=\"h-card h-person\"><abbr class=\"p-name\" title=\"Example User\">@example</abbr></div>"
+
+         {:items [{:properties {:name "Example User"}}] :rels {}}
+         "<div class=\"h-card\"><data class=\"p-name\" value=\"Example User\"></data></div>"
+         )))