implement tests for selection methods with invalid selector strings

This commit is contained in:
Martin Angers
2016-06-15 08:42:27 -04:00
parent 2cd8b4e49a
commit 9cc531274b
7 changed files with 155 additions and 20 deletions

View File

@@ -9,6 +9,16 @@ func TestAdd(t *testing.T) {
assertLength(t, sel.Nodes, 19)
}
func TestAddInvalid(t *testing.T) {
sel1 := Doc().Find("div.row-fluid")
sel2 := sel1.Add("")
assertLength(t, sel1.Nodes, 19)
assertLength(t, sel2.Nodes, 19)
if sel1 == sel2 {
t.Errorf("selections should not be the same")
}
}
func TestAddRollback(t *testing.T) {
sel := Doc().Find(".pvk-content")
sel2 := sel.Add("a").End()