Add @when decorator (#1428)

* Add new _event_handling.py file with @when decorator

* @when decorate is in pyscript package namespace/_all__

* Write tests in new test_event_handling.py

* Add docs for @when decorator

------------

Co-authored-by: Mariana Meireles <marian.meireles@gmail.com>
This commit is contained in:
Jeff Glass
2023-05-01 09:51:49 -05:00
committed by GitHub
parent 0a4e36ae09
commit 3a66be585f
7 changed files with 338 additions and 0 deletions

View File

@@ -316,6 +316,7 @@ class TestBasic(PyScriptTest):
)
btn = self.page.wait_for_selector("button")
btn.click()
self.wait_for_console("hello world!")
assert self.console.log.lines[-1] == "hello world!"
assert self.console.error.lines == []