fix tests after reorganization

This commit is contained in:
Martin Angers
2012-08-30 17:38:51 -04:00
parent de74d0bf97
commit d17b003dc8
8 changed files with 43 additions and 36 deletions
+6 -6
View File
@@ -5,21 +5,21 @@ import (
)
func TestFilter(t *testing.T) {
sel := doc.Find(".span12").Filter(".alert")
sel := Doc().Find(".span12").Filter(".alert")
if len(sel.Nodes) != 1 {
t.Errorf("Expected 1 node, found %v.", len(sel.Nodes))
}
}
func TestFilterNone(t *testing.T) {
sel := doc.Find(".span12").Filter(".zzalert")
sel := Doc().Find(".span12").Filter(".zzalert")
if sel.Nodes != nil {
t.Error("Expected no node (nil), found some.")
}
}
func TestFilterFunction(t *testing.T) {
sel := doc.Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
return i > 0
})
if len(sel.Nodes) != 2 {
@@ -28,7 +28,7 @@ func TestFilterFunction(t *testing.T) {
}
func TestFilterNode(t *testing.T) {
sel := doc.Find(".pvk-content")
sel := Doc().Find(".pvk-content")
sel2 := sel.FilterNodes(sel.Nodes[2])
if len(sel2.Nodes) != 1 {
t.Errorf("Expected 1 node, found %v.", len(sel2.Nodes))
@@ -36,8 +36,8 @@ func TestFilterNode(t *testing.T) {
}
func TestFilterSelection(t *testing.T) {
sel := doc.Find(".link")
sel2 := doc.Find("a[ng-click]")
sel := Doc().Find(".link")
sel2 := Doc().Find("a[ng-click]")
sel3 := sel.FilterSelection(sel2)
if len(sel3.Nodes) != 1 {
t.Errorf("Expected 1 node, found %v.", len(sel3.Nodes))