func TestEveryEntryHasCaptchaSection(t *testing.T) { for _, e := range testPosts { node := htmltest.QueryOne(t, e.URL, ".author") assertElem(t, node, "div") require.NotEmpty(t, h5.Children(node), "Empty author div!") checkAuthorSection(T{t}, node) } }
func TestBasicStructure(t *testing.T) { var blocks = []string{ "#header", "#subheader", "#content", "#footer", "#sidebar", } for _, block := range blocks { node := htmltest.QueryOne(t, "", block) assertElem(t, node, "div") } }
func TestNewPostShowsEmptyForm(t *testing.T) { titleInput := htmltest.QueryOne(t, "edit_post", "#post_title") assertElem(t, titleInput, "input") bodyTextArea := htmltest.QueryOne(t, "edit_post", "#wmd-input") assertElem(t, bodyTextArea, "textarea") }
func TestAdminPageHasAllCommentsButton(t *testing.T) { ensureLogin() node := htmltest.QueryOne(t, "/admin", "#display-all-comments") assertElem(t, node, "input") }
func TestEveryCommentHasEditFormWhenLoggedId(t *testing.T) { ensureLogin() node := htmltest.QueryOne(t, testPosts[0].URL, "#edit-comment-form") assertElem(t, node, "form") }
func TestLoginPage(t *testing.T) { node := htmltest.QueryOne(t, "login", "#login_form") assertElem(t, node, "form") }
func TestPostPageHasCommentEditor(t *testing.T) { for _, p := range testPosts { node := htmltest.QueryOne(t, p.URL, "#comment") assertElem(t, node, "form") } }