add Next() and NextFiltered() with tests

This commit is contained in:
Martin Angers
2012-09-04 12:07:59 -04:00
parent ff0cbc32c4
commit ed3b9aca8a
4 changed files with 79 additions and 12 deletions

View File

@@ -132,3 +132,28 @@ func TestSiblingsFiltered(t *testing.T) {
sel := Doc().Root.Find(".pvk-gutter").SiblingsFiltered(".pvk-content")
AssertLength(t, sel.Nodes, 3)
}
func TestNext(t *testing.T) {
sel := Doc().Root.Find("h1").Next()
AssertLength(t, sel.Nodes, 1)
}
func TestNext2(t *testing.T) {
sel := Doc().Root.Find(".close").Next()
AssertLength(t, sel.Nodes, 1)
}
func TestNextNone(t *testing.T) {
sel := Doc().Root.Find("small").Next()
AssertLength(t, sel.Nodes, 0)
}
func TestNextFiltered(t *testing.T) {
sel := Doc().Root.Find(".container-fluid").NextFiltered("div")
AssertLength(t, sel.Nodes, 2)
}
func TestNextFiltered2(t *testing.T) {
sel := Doc().Root.Find(".container-fluid").NextFiltered("[ng-view]")
AssertLength(t, sel.Nodes, 1)
}