diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/app.test.js | 23 | ||||
-rw-r--r-- | test/domain/posts.test.js | 1 | ||||
-rw-r--r-- | test/testsite/posts/testfile.md | 1 |
3 files changed, 25 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" + ); }); }); diff --git a/test/domain/posts.test.js b/test/domain/posts.test.js index c433ce5..cc236c7 100644 --- a/test/domain/posts.test.js +++ b/test/domain/posts.test.js @@ -14,6 +14,7 @@ test("get", t => { Object.entries({ title: "This is a test", description: "Test file", + date: new Date("2017-01-01T00:00:00Z"), tags: ["a", "b"] }) ); diff --git a/test/testsite/posts/testfile.md b/test/testsite/posts/testfile.md index 65f2122..84d8ed1 100644 --- a/test/testsite/posts/testfile.md +++ b/test/testsite/posts/testfile.md @@ -1,6 +1,7 @@ +++ Title = "This is a test" Description = "Test file" +Date = 2017-01-01T02:00:00+02:00 Tags = ["a", "b"] +++ Ut enim blandit volutpat maecenas? Volutpat blandit aliquam etiam erat |