all repos — archive/homestead @ 2d931962b74fe06c1bfbc2454fa166d24e8e2f59

My future indieweb platform

feat: Add date to posts

Alan Pearce
commit

2d931962b74fe06c1bfbc2454fa166d24e8e2f59

parent

b0b4517c1329595f9525bcc9e9e176dc5b43f575

1 file changed, 23 insertions(+), 0 deletions(-)

changed files
M test/app.test.jstest/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" ); }); });