all repos — archive/homestead @ 31eda3eb3150c35b469ba193db227e0467653081

My future indieweb platform

test: add description to basic tests

Alan Pearce
commit

31eda3eb3150c35b469ba193db227e0467653081

parent

6fd0c4b95eb82e5c60b3740dabcfe4590fe78d82

1 file changed, 36 insertions(+), 11 deletions(-)

changed files
M test/app.test.jstest/app.test.js
@@ -29,11 +29,15 @@ .expect(200)
.expect(/^<!DOCTYPE html>/) .then(parseResponse) .then($ => { - t.is($("head > title").text(), "John Doe"); - t.is($("h1").text(), "John Doe"); - t.is($("main").length, 1); - t.is($("main .posts").length, 1); - t.is($(".post:first-of-type a").attr("href"), "/post/testfile"); + t.is($("head > title").text(), "John Doe", "head title is site author"); + t.is($("h1").text(), "John Doe", "h1 is site author"); + t.is($("main").length, 1, "only one <main> tag"); + t.is($("main .posts").length, 1, "contains one posts listing"); + t.is( + $(".post:first-of-type a").attr("href"), + "/post/testfile", + "first post url" + ); return $; }) .then(toMicroformatsOptions)
@@ -67,13 +71,22 @@ .expect(200)
.expect(/^<!DOCTYPE html>/) .then(parseResponse) .then($ => { - t.is($("head > title").text(), "This is a test · " + "John Doe"); - t.is($("article h1").text(), "This is a test"); + t.is( + $("head > title").text(), + "This is a test · " + "John Doe", + "head title contains post and site author" + ); + t.is( + $("article h1").text(), + "This is a test", + "article header is post title" + ); 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 \ -urna duis convallis convallis tellus, id interdum velit laoreet!` +urna duis convallis convallis tellus, id interdum velit laoreet!`, + "article has text" ); }); });
@@ -93,9 +106,21 @@ .expect(200)
.expect(/^<!DOCTYPE html>/) .then(parseResponse) .then($ => { - t.is($("head > title").text(), "A · John Doe"); - t.is($(".post a").text(), "This is a test"); - t.is($(".post:first-of-type a").attr("href"), "/post/testfile"); + t.is( + $("head > title").text(), + "A · John Doe", + "head title contains title-cased tag and site name" + ); + t.is( + $(".post a").text(), + "This is a test", + "post link text is post title" + ); + t.is( + $(".post:first-of-type a").attr("href"), + "/post/testfile", + "post url" + ); }); });