Minor documentation cleanup from last commit

This commit is contained in:
Kenneth Shaw 2017-12-18 10:48:40 +07:00
parent 07208b1cc3
commit 380c95b6c0
2 changed files with 7 additions and 6 deletions

View File

@ -209,9 +209,10 @@ func Attributes(sel interface{}, attributes *map[string]string, opts ...QueryOpt
}, opts...)
}
// AttributesAll retrieves the element attributes for every nodes matching the
// AttributesAll retrieves the element attributes for all nodes matching the
// selector.
// selector should be ByQueryAll
//
// Note: this should be used with the ByQueryAll selector option.
func AttributesAll(sel interface{}, attributes *[]map[string]string, opts ...QueryOption) Action {
if attributes == nil {
panic("attributes cannot be nil")

View File

@ -448,14 +448,14 @@ func TestSetAttributes(t *testing.T) {
exp map[string]string
}{
{`//*[@id="icon-brankas"]`, BySearch,
map[string]string{"data-url": "brankas"},
map[string]string{"data-url": "brankas"},
map[string]string{
"alt": "Brankas - Easy Money Management",
"id": "icon-brankas",
"src": "images/brankas.png",
"data-url": "brankas"}},
{"body > img:first-child", ByQuery,
map[string]string{"data-url": "brankas"},
map[string]string{"data-url": "brankas"},
map[string]string{
"alt": "Brankas - Easy Money Management",
"id": "icon-brankas",
@ -463,7 +463,7 @@ func TestSetAttributes(t *testing.T) {
"data-url": "brankas",
}},
{"body > img:nth-child(2)", ByQueryAll,
map[string]string{"width": "100", "height": "200"},
map[string]string{"width": "100", "height": "200"},
map[string]string{
"alt": `How people build software`,
"id": "icon-github",
@ -472,7 +472,7 @@ func TestSetAttributes(t *testing.T) {
"height": "200",
}},
{"#icon-github", ByID,
map[string]string{"width": "100", "height": "200"},
map[string]string{"width": "100", "height": "200"},
map[string]string{
"alt": "How people build software",
"id": "icon-github",