MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_append_string

Method test_append_string

core/tests/python/tests/test_web.py:296–303  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

294 Ensure that appending a string adds a text node.
295 """
296 def test_append_string(self):
297 id_ = "element-append-tests"
298 div = web.page[f"#{id_}"]
299 len_children_before = len(div.children)
300 text_to_append = "a simple string"
301 div.append(text_to_append)
302 assert len(div.children) == len_children_before
303 assert div._dom_element.textContent.endswith(text_to_append)
304
305 """
306 Test that appending a string does not overwrite existing children.

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected