Skip to content

Commit caa5131

Browse files
author
SentienceDEV
committed
fix test
1 parent 4524926 commit caa5131

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sentience/query.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ def match_element(element: Element, query: dict[str, Any]) -> bool: # noqa: C90
159159

160160
# Role exact match
161161
if "role" in query:
162-
if element.role != query["role"]:
163-
return False
162+
if query["role"] == "link":
163+
if element.role != "link" and not element.href:
164+
return False
165+
else:
166+
if element.role != query["role"]:
167+
return False
164168

165169
# Role exclusion
166170
if "role_exclude" in query:

0 commit comments

Comments
 (0)