about summary refs log tree commit diff stats
path: root/test/microformats/parser_expectations.clj
diff options
context:
space:
mode:
authorAlan Pearce2014-09-27 13:19:28 +0100
committerAlan Pearce2014-09-27 13:19:28 +0100
commitb702d4ca7f3eb140a5436469e3bc05d997b1bb26 (patch)
tree40b44d1212d75311c8b8eb3dce61bf856dce2bc9 /test/microformats/parser_expectations.clj
parent652b21ab446448e52a0a1a2e8a43ff98968a549f (diff)
downloadmicroformats-b702d4ca7f3eb140a5436469e3bc05d997b1bb26.tar.lz
microformats-b702d4ca7f3eb140a5436469e3bc05d997b1bb26.tar.zst
microformats-b702d4ca7f3eb140a5436469e3bc05d997b1bb26.zip
Only select the first level of h- elements
Diffstat (limited to 'test/microformats/parser_expectations.clj')
-rw-r--r--test/microformats/parser_expectations.clj21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/microformats/parser_expectations.clj b/test/microformats/parser_expectations.clj
index 1783af5..455a26f 100644
--- a/test/microformats/parser_expectations.clj
+++ b/test/microformats/parser_expectations.clj
@@ -24,6 +24,27 @@
              snippet :content
              (#'microformats.parser/node-to-text)))
 
+(expect '({:tag :div :attrs {:class "h-card"}
+                   :content nil})
+                (select-h (snippet
+                           "<div class=\"h-card\"></div>")))
+
+(expect '({:tag :div :attrs {:class "h-card"}
+                   :content ({:tag :a :attrs {:class "h-org"}
+                              :content nil})})
+                (select-h (snippet
+                           "<div class=\"h-card\"><a class=\"h-org\"></a></div>")))
+
+(expect '({:tag :div :attrs {:class "h-card"}
+                   :content ("\n"
+                             {:tag :p :attrs nil
+                              :content ({:tag :a :attrs {:class "h-org"}
+                                         :content nil})}
+                             "\n")})
+        (select-h (snippet "<div class=\"h-card\">
+<p><a class=\"h-org\"></a></p>
+</div>")))
+
 (expect {:name '("Name")}
         (parse-p (snippet "<p class=\"p-name\"><span class=\"value\">Name</span></p>")))