diff options
author | Alan Pearce | 2017-07-01 14:11:52 +0200 |
---|---|---|
committer | Alan Pearce | 2017-07-01 14:12:07 +0200 |
commit | 2d931962b74fe06c1bfbc2454fa166d24e8e2f59 (patch) | |
tree | 028972fae8fe6d7274ad58ccae5ac8bcc1f93d8e /test/app.test.js | |
parent | b0b4517c1329595f9525bcc9e9e176dc5b43f575 (diff) | |
download | homestead-2d931962b74fe06c1bfbc2454fa166d24e8e2f59.tar.lz homestead-2d931962b74fe06c1bfbc2454fa166d24e8e2f59.tar.zst homestead-2d931962b74fe06c1bfbc2454fa166d24e8e2f59.zip |
feat: Add date to posts
Diffstat (limited to 'test/app.test.js')
-rw-r--r-- | test/app.test.js | 23 |
1 files changed, 23 insertions, 0 deletions
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) @@ -84,6 +93,15 @@ test("post", t => { "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 \ @@ -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" + ); }); }); |