From 2d931962b74fe06c1bfbc2454fa166d24e8e2f59 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 1 Jul 2017 14:11:52 +0200 Subject: feat: Add date to posts --- test/app.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/app.test.js') diff --git a/test/app.test.js b/test/app.test.js index f673247..6810089 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -39,6 +39,15 @@ test("homepage", t => { "/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) @@ -83,6 +92,15 @@ test("post", t => { "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 \ @@ -124,6 +142,11 @@ test("tags", t => { "/post/testfile", "post url" ); + t.is( + $(".post:first-of-type time").text(), + "Sunday, January 1, 2017", + "first post date" + ); }); }); -- cgit 1.4.1