add Siblings() with tests

This commit is contained in:
Martin Angers
2012-09-04 11:15:09 -04:00
parent f461c82030
commit b26e37d262
2 changed files with 31 additions and 0 deletions

View File

@@ -112,3 +112,13 @@ func TestParentsFilteredUntilNodes(t *testing.T) {
sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...)
AssertLength(t, sel.Nodes, 1)
}
func TestSiblings(t *testing.T) {
sel := Doc().Root.Find("h1").Siblings()
AssertLength(t, sel.Nodes, 1)
}
func TestSiblings2(t *testing.T) {
sel := Doc().Root.Find(".pvk-gutter").Siblings()
AssertLength(t, sel.Nodes, 9)
}