summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAlan Pearce2017-07-05 22:15:03 +0200
committerAlan Pearce2017-07-05 22:15:03 +0200
commitcff6bcc31d59ce9957567cc05c1ed7e364fb40ca (patch)
tree7de5191c9308860b9e83a271be07e6d85a179f95 /test
parentd01f2aa860b0d5f10dc8e143c4b1b9d420fc8fe0 (diff)
downloadhomestead-cff6bcc31d59ce9957567cc05c1ed7e364fb40ca.tar.lz
homestead-cff6bcc31d59ce9957567cc05c1ed7e364fb40ca.tar.zst
homestead-cff6bcc31d59ce9957567cc05c1ed7e364fb40ca.zip
Add rel=me links
Diffstat (limited to 'test')
-rw-r--r--test/app.test.js13
-rw-r--r--test/snapshots/app.test.js.md76
-rw-r--r--test/snapshots/app.test.js.snapbin1658 -> 1880 bytes
3 files changed, 79 insertions, 10 deletions
diff --git a/test/app.test.js b/test/app.test.js
index 1f8e72f..f0ab3da 100644
--- a/test/app.test.js
+++ b/test/app.test.js
@@ -47,6 +47,11 @@ test("homepage", async function(t) {
   t.is($("main").length, 1, "only one <main> tag");
   t.is($("nav a").first().text(), "Home", "nav link has text");
   t.is($("nav a").first().attr("href"), "/", "nav links to homepage");
+  t.is(
+    $("a[rel=me]").length,
+    2,
+    "renders author.contact config to rel=me links"
+  );
 
   const options = toMicroformatsOptions($);
   const count = await mf.countAsync(options);
@@ -55,7 +60,7 @@ test("homepage", async function(t) {
     "h-card": 1,
     "h-feed": 1,
     "h-entry": 1,
-    rels: 1
+    rels: 3
   });
 
   const data = await mf.getAsync(options);
@@ -86,7 +91,7 @@ test("posts", async function(t) {
     "h-card": 1,
     "h-feed": 1,
     "h-entry": 1,
-    rels: 1
+    rels: 3
   });
 
   const data = await mf.getAsync(options);
@@ -117,7 +122,7 @@ test("post", async function(t) {
   t.deepEqual(count, {
     "h-card": 1,
     "h-entry": 1,
-    rels: 1
+    rels: 3
   });
 
   const data = await mf.getAsync(options);
@@ -147,7 +152,7 @@ test("tags", async function(t) {
     "h-card": 1,
     "h-feed": 1,
     "h-entry": 1,
-    rels: 1
+    rels: 3
   });
 
   const data = await mf.getAsync(options);
diff --git a/test/snapshots/app.test.js.md b/test/snapshots/app.test.js.md
index 02eac70..599fe22 100644
--- a/test/snapshots/app.test.js.md
+++ b/test/snapshots/app.test.js.md
@@ -62,8 +62,24 @@ Generated by [AVA](https://ava.li).
             'stylesheet',
           ],
         },
+        'https://twitter.com/johndoe': {
+          rels: [
+            'me',
+          ],
+          text: 'Twitter',
+        },
+        'mailto:johndoe@johndoe.org': {
+          rels: [
+            'me',
+          ],
+          text: 'johndoe@johndoe.org',
+        },
       },
       rels: {
+        me: [
+          'mailto:johndoe@johndoe.org',
+          'https://twitter.com/johndoe',
+        ],
         stylesheet: [
           '/css/code.css',
         ],
@@ -118,15 +134,31 @@ Generated by [AVA](https://ava.li).
             'stylesheet',
           ],
         },
+        'https://twitter.com/johndoe': {
+          rels: [
+            'me',
+          ],
+          text: 'Twitter',
+        },
+        'mailto:johndoe@johndoe.org': {
+          rels: [
+            'me',
+          ],
+          text: 'johndoe@johndoe.org',
+        },
       },
       rels: {
+        me: [
+          'mailto:johndoe@johndoe.org',
+          'https://twitter.com/johndoe',
+        ],
         stylesheet: [
           '/css/code.css',
         ],
       },
     }
 
-## tags
+## posts
 
 > should contain relevant microformats data
 
@@ -170,7 +202,7 @@ Generated by [AVA](https://ava.li).
           ],
           properties: {
             name: [
-              'A · John Doe',
+              'Posts · John Doe',
             ],
           },
           type: [
@@ -184,15 +216,31 @@ Generated by [AVA](https://ava.li).
             'stylesheet',
           ],
         },
+        'https://twitter.com/johndoe': {
+          rels: [
+            'me',
+          ],
+          text: 'Twitter',
+        },
+        'mailto:johndoe@johndoe.org': {
+          rels: [
+            'me',
+          ],
+          text: 'johndoe@johndoe.org',
+        },
       },
       rels: {
+        me: [
+          'mailto:johndoe@johndoe.org',
+          'https://twitter.com/johndoe',
+        ],
         stylesheet: [
           '/css/code.css',
         ],
       },
-    
+    }
 
-## posts
+## tags
 
 > should contain relevant microformats data
 
@@ -236,7 +284,7 @@ Generated by [AVA](https://ava.li).
           ],
           properties: {
             name: [
-              'Posts · John Doe',
+              'A · John Doe',
             ],
           },
           type: [
@@ -250,10 +298,26 @@ Generated by [AVA](https://ava.li).
             'stylesheet',
           ],
         },
+        'https://twitter.com/johndoe': {
+          rels: [
+            'me',
+          ],
+          text: 'Twitter',
+        },
+        'mailto:johndoe@johndoe.org': {
+          rels: [
+            'me',
+          ],
+          text: 'johndoe@johndoe.org',
+        },
       },
       rels: {
+        me: [
+          'mailto:johndoe@johndoe.org',
+          'https://twitter.com/johndoe',
+        ],
         stylesheet: [
           '/css/code.css',
         ],
       },
-    }
\ No newline at end of file
+    }
diff --git a/test/snapshots/app.test.js.snap b/test/snapshots/app.test.js.snap
index b7ca373..dd02042 100644
--- a/test/snapshots/app.test.js.snap
+++ b/test/snapshots/app.test.js.snap
Binary files differ