Added icons
Updated README.md Started test framework utils
This commit is contained in:
26
tests/test_integration_commands.py
Normal file
26
tests/test_integration_commands.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from fasthtml.fastapp import fast_app
|
||||
|
||||
from myfasthtml.controls.button import mk_button
|
||||
from myfasthtml.core.commands import Command
|
||||
from myfasthtml.core.testclient import MyTestClient
|
||||
|
||||
|
||||
def new_value(value):
|
||||
return value
|
||||
|
||||
|
||||
command = Command('test', 'TestingCommand', new_value, "this is my new value")
|
||||
|
||||
|
||||
def test_i_can_trigger_a_command():
|
||||
test_app, rt = fast_app(default_hdrs=False)
|
||||
user = MyTestClient(test_app)
|
||||
|
||||
@rt('/')
|
||||
def get(): return mk_button('button', command)
|
||||
|
||||
user.open("/")
|
||||
user.should_see("button")
|
||||
b = user.find_element("button")
|
||||
b.click()
|
||||
user.should_see("this is my new value")
|
||||
Reference in New Issue
Block a user