mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-10-09 18:50:33 +08:00
add Parents() and ParentsFiltered(), with tests
This commit is contained in:
@@ -64,3 +64,13 @@ func TestParentFiltered(t *testing.T) {
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertClass(t, sel, "hero-unit")
|
||||
}
|
||||
|
||||
func TestParents(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").Parents()
|
||||
AssertLength(t, sel.Nodes, 8)
|
||||
}
|
||||
|
||||
func TestParentsFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").ParentsFiltered("body")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
Reference in New Issue
Block a user