Skip to content

Commit 7cea752

Browse files
expose name='id' issue in failing test.
1 parent c89b5bb commit 7cea752

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/fidelity.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,14 @@ describe("Tests to ensure that idiomorph merges properly", function () {
156156

157157
element.outerHTML.should.equal(finalSrc);
158158
});
159+
160+
it("issue https://github.com/bigskysoftware/idiomorph/issues/135", function () {
161+
// inputs with name="id" make their form's id property unreliable!
162+
// form.id returns the <input>, not "myForm", breaking idiomorph's element persistence
163+
let src = `<form id="myForm"><input name="id"></form>`;
164+
getWorkArea().innerHTML = src;
165+
let element = getWorkArea().querySelector("form");
166+
Idiomorph.morph(getWorkArea(), src, { morphStyle: "innerHTML" });
167+
should.equal(element, getWorkArea().querySelector("form"));
168+
});
159169
});

0 commit comments

Comments
 (0)