diff --git a/pyscriptjs/tests/integration/test_02_output.py b/pyscriptjs/tests/integration/test_02_output.py index cdae78b4..d927647d 100644 --- a/pyscriptjs/tests/integration/test_02_output.py +++ b/pyscriptjs/tests/integration/test_02_output.py @@ -1,8 +1,6 @@ import html import re -import pytest - from .support import PyScriptTest @@ -19,7 +17,6 @@ class TestOutput(PyScriptTest): pattern = r'
hello world
' assert re.search(pattern, inner_html) - @pytest.mark.xfail(reason="issue #878") def test_consecutive_display(self): self.pyscript_run( """ @@ -37,12 +34,11 @@ class TestOutput(PyScriptTest): lines = [line for line in lines if line != ""] # remove empty lines assert lines == ["hello 1", "hello 2", "hello 3"] - @pytest.mark.xfail(reason="fix me") - def test_output_attribute(self): + def test_target_attribute(self): self.pyscript_run( """ - - display('hello world') + + display('hello world', target="mydiv")
""" @@ -50,6 +46,26 @@ class TestOutput(PyScriptTest): mydiv = self.page.locator("#mydiv") assert mydiv.inner_text() == "hello world" + def test_consecutive_display_target(self): + self.pyscript_run( + """ + + display('hello 1') + +

hello in between 1 and 2

+ + display('hello 2', target="second") + + + display('hello 3') + + """ + ) + inner_text = self.page.inner_text("body") + lines = inner_text.splitlines() + lines = [line for line in lines if line != ""] # remove empty lines + assert lines == ["hello 1", "hello in between 1 and 2", "hello 2", "hello 3"] + def test_multiple_display_calls_same_tag(self): self.pyscript_run( """