mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
test(spec): pin className and class on the same elements
this host answers both names against the live DOM and internal/hierarchy now aliases the second onto the first, so a name dropped from the table here would match nothing on web while the dump still answers it.
This commit is contained in:
1 parent
53ee9aa292
commit
2cbd60d70b
1 file changed
+16
@@ -942,6 +942,22 @@ test("text is ANDed with a state key before the innermost rule", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// class and className are two names for the one attribute every producer
|
||||
// writes as class, and internal/hierarchy aliases the second onto the first.
|
||||
// This host answers both, so the pair is pinned here: a name dropped from this
|
||||
// table matches nothing on web while the dump still answers it, and an empty
|
||||
// result reads exactly like a screen with no such element.
|
||||
test("className and class name the same elements", () => {
|
||||
const badge = fakeElement({
|
||||
tag: "span", x: 0, y: 0, width: 40, height: 20, id: "status_badge",
|
||||
attrs: { class: "status" }, text: "Sent",
|
||||
});
|
||||
withFakeDocument([badge], () => {
|
||||
assert.deepEqual(matchedIDs({ className: "status" }), ["status_badge"]);
|
||||
assert.deepEqual(matchedIDs({ class: "status" }), ["status_badge"]);
|
||||
});
|
||||
});
|
||||
|
||||
test("attrs carries every other attribute alongside tag and aria-label", () => {
|
||||
const attrs = attrsOf(
|
||||
domElement({ tag: "input", attributes: { id: "txn-note", placeholder: "What's this for?" } }),
|
||||
|
||||
Reference in new issue
Block a user