test(chrome): compare className across both matchers

one page, both resolvers, the two names for the one attribute. class is
asked beside className so the pair is pinned to the same elements rather
than each to itself: the row and the badge under it both carry it.
This commit is contained in:
pj committed 2026-08-19 09:55:25 +05:30
1 parent 5f66e5fb3e
commit 53ee9aa292
1 file changed
+19
@@ -108,6 +108,25 @@ func TestSelectors_ResolveTheSameElementsAsTheWebRuntime(t *testing.T) {
object: objectSelector("data-state", "sent"), object: objectSelector("data-state", "sent"),
want: []string{"status_badge"}, want: []string{"status_badge"},
}, },
{
name: "class",
selector: "class:status",
object: objectSelector("class", "status"),
want: []string{"nested_row", "nested_badge"},
},
{
// className is the DOM property name for the same attribute, and
// the two names have to name the same elements: the web runtime
// compiles both to the same class query, while the dump carries
// the fact under `class` alone and no alias reached it, so this
// key matched the row and the badge on one host and NOTHING on the
// other. The key is accepted, so no unknown-key error fires, and a
// property over the missing element passes having checked nothing.
name: "className",
selector: "className:status",
object: objectSelector("className", "status"),
want: []string{"nested_row", "nested_badge"},
},
{ {
// A custom element's tag name holds a real tag name inside it, so a // A custom element's tag name holds a real tag name inside it, so a
// substring rule answered tag:li with <todo-list> and tag:a with // substring rule answered tag:li with <todo-list> and tag:a with