Ejemplo n.º 1
0
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)
	}
}
Ejemplo n.º 2
0
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")
	}
}
Ejemplo n.º 3
0
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")
}
Ejemplo n.º 4
0
func TestAdminPageHasAllCommentsButton(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, "/admin", "#display-all-comments")
	assertElem(t, node, "input")
}
Ejemplo n.º 5
0
func TestEveryCommentHasEditFormWhenLoggedId(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, testPosts[0].URL, "#edit-comment-form")
	assertElem(t, node, "form")
}
Ejemplo n.º 6
0
func TestLoginPage(t *testing.T) {
	node := htmltest.QueryOne(t, "login", "#login_form")
	assertElem(t, node, "form")
}
Ejemplo n.º 7
0
func TestPostPageHasCommentEditor(t *testing.T) {
	for _, p := range testPosts {
		node := htmltest.QueryOne(t, p.URL, "#comment")
		assertElem(t, node, "form")
	}
}