fix(spec): match a merged label by its leading name on web too

The native desc rule accepts the label or the label at the head of an iOS
merged label; both web translators compared the whole string, so the same
selector matched natively and missed on web. The live-page parity test
caught it.
This commit is contained in:
pj committed 2026-08-13 00:41:23 +05:30
1 parent b8bb44cf61
commit cb880edf44
4 files changed
+20 -3

No files matched your search

+2 -1
View File
@@ -16,7 +16,8 @@ func TestTranslateStringSelector_KnownKeys(t *testing.T) {
{`text:Say "hi"`, `//*[normalize-space(text())='Say "hi"']`, true},
{`text:it's`, `//*[normalize-space(text())="it's"]`, true},
{`text:it's "fine"`, `//*[normalize-space(text())=concat("it's ", '"', "fine", '"', "")]`, true},
{"desc:logout", `[aria-label="logout"]`, false},
// desc also accepts an iOS merged label, the way internal/hierarchy does.
{"desc:logout", `:is([aria-label="logout"], [aria-label^="logout, "])`, false},
{"label:logout", `[aria-label="logout"]`, false},
{"accessibilityLabel:logout", `[aria-label="logout"]`, false},
{"aria-label:Sign in", `[aria-label="Sign in"]`, false},