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

Method test_text_attribute

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

Source from the content-addressed store, hash-verified

425 assert div.textContent == div._dom_element.textContent == "New Content"
426
427 def test_text_attribute(self):
428 # GIVEN an existing element on the page with a known empty text content
429 div = web.page.find("#element_attribute_tests")[0]
430
431 # WHEN we set the html attribute
432 div.textContent = "<b>New Content</b>"
433
434 # EXPECT the element html and underlying JS Element innerHTML property
435 # to match what we expect and what
436 assert (
437 div.innerHTML
438 == div._dom_element.innerHTML
439 == "&lt;b&gt;New Content&lt;/b&gt;"
440 )
441 assert div.textContent == div._dom_element.textContent == "<b>New Content</b>"
442
443 def test_update_classes(self):
444 """Test updating classes via update()."""

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected