mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-22 03:35:31 -05:00
pys-onClick shouldn't prevent splashscreen from closing (#1069)
This commit is contained in:
@@ -78,3 +78,22 @@ class TestSplashscreen(PyScriptTest):
|
||||
expect(div).to_contain_text("Startup complete")
|
||||
assert self.console.log.lines[0] == self.PY_COMPLETE
|
||||
assert "hello pyscript" in self.console.log.lines
|
||||
|
||||
def test_splashscreen_closes_on_error_with_pys_onClick(self):
|
||||
self.pyscript_run(
|
||||
"""
|
||||
<button id="submit-button" type="submit" pys-onClick="myFunc">OK</button>
|
||||
|
||||
<py-script>
|
||||
from js import console
|
||||
|
||||
def myFunc(*args, **kwargs):
|
||||
text = Element('test-input').element.value
|
||||
Element('test-output').element.innerText = text
|
||||
|
||||
</py-script>
|
||||
""",
|
||||
)
|
||||
|
||||
assert self.page.locator("py-splashscreen").count() == 0
|
||||
assert "Python exception" in self.console.error.text
|
||||
|
||||
Reference in New Issue
Block a user