feat: Add date to posts
1 file changed, 23 insertions(+), 0 deletions(-)
changed files
M test/app.test.js → test/app.test.js
@@ -39,6 +39,15 @@ $(".post:first-of-type a").attr("href"), "/post/testfile", "first post url" ); + t.is( + $(".post:first-of-type time").text(), + "Sunday, January 1, 2017", + "first post date" + ); + t.is( + $(".post:first-of-type time").attr("datetime"), + new Date("2017-01-01").toISOString() + ); return $; }) .then(toMicroformatsOptions)@@ -84,6 +93,15 @@ "This is a test", "article header is post title" ); t.is( + $("article time").text(), + "Sunday, January 1, 2017", + "first post date" + ); + t.is( + $("article time").attr("datetime"), + new Date("2017-01-01").toISOString() + ); + t.is( $("article p").text(), `Ut enim blandit volutpat maecenas? Volutpat blandit aliquam etiam erat \ velit, scelerisque in dictum non, consectetur a erat nam at lectus \@@ -123,6 +141,11 @@ t.is( $(".post:first-of-type a").attr("href"), "/post/testfile", "post url" + ); + t.is( + $(".post:first-of-type time").text(), + "Sunday, January 1, 2017", + "first post date" ); }); });