Skip to content

Commit 902b8fc

Browse files
committed
add insertAdjacentHTML test
1 parent 923491a commit 902b8fc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/tests/dom/element.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,17 @@
289289
linkElement.rel = "stylesheet";
290290
testing.expectEqual("stylesheet", linkElement.rel);
291291
</script>
292+
293+
<script id=insertAdjacentHTML>
294+
const el4 = document.createElement("div");
295+
296+
const el5 = document.createElement("span");
297+
el4.appendChild(el5);
298+
299+
const el6 = document.createElement("p");
300+
el6.innerText = "content";
301+
el4.appendChild(el6);
302+
303+
el5.insertAdjacentHTML("beforebegin", "<h1>title</h1>");
304+
testing.expectEqual("<h1>title</h1><span></span><p>content</p>", el4.innerHTML);
305+
</script>

0 commit comments

Comments
 (0)