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

+8
View File
@@ -342,6 +342,14 @@ test("selectorFromObject routes idPrefix to a starts-with id match", () => {
});
});
// The native rule matches an iOS merged label ("account_card:7, Tim, $100") by
// its leading name, and the web table has to mean the same thing by desc.
test("selectorFromObject matches a merged label by its leading name", () => {
assert.deepEqual(selectorFromObject({ desc: "account_card" }), {
css: `:is([aria-label="account_card"], [aria-label^="account_card, "])`,
});
});
test("selectorFromString and selectorFromObject agree on descPrefix", () => {
assert.deepEqual(selectorFromString("descPrefix:account:"), {
css: `[aria-label^="account\\:"]`,