mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(web): resolve testTag through data-testid or id
Compose Multiplatform emits its testTag into the element id, which the native table already accepts via the resource-id alias. The two web selector tables were the only place that rejected it. Claude-Session: https://claude.ai/code/session_01Fj4wJUikdABuMQEETwW55J
This commit is contained in:
1 parent
be2fbadc9d
commit
d25b56379a
4 files changed
+31
-3
No files matched your search
@@ -42,7 +42,13 @@ func TranslateStringSelector(selector string) (string, bool, error) {
|
||||
return `[aria-label="` + cssEscape(value) + `"]`, false, nil
|
||||
case "descPrefix":
|
||||
return `[aria-label^="` + cssEscape(value) + `"]`, false, nil
|
||||
case "testTag", "testID", "testid", "data-testid":
|
||||
case "testTag":
|
||||
// Mirrors the in-page table and the native resource-id alias: a
|
||||
// testTag reaches the DOM as data-testid or as an id, depending on
|
||||
// the toolkit. `:is()` keeps this one compound selector.
|
||||
escaped := cssEscape(value)
|
||||
return `:is([data-testid="` + escaped + `"], [id="` + escaped + `"])`, false, nil
|
||||
case "testID", "testid", "data-testid":
|
||||
return `[data-testid="` + cssEscape(value) + `"]`, false, nil
|
||||
case "placeholder", "placeholderValue", "hintText":
|
||||
return `[placeholder="` + cssEscape(value) + `"]`, false, nil
|
||||
|
||||
Reference in new issue
Block a user