test_splitter.py 681 B

12345678910111213141516171819
  1. from nicegui import ui
  2. from .screen import Screen
  3. def test_splitter(screen: Screen):
  4. with ui.splitter() as splitter:
  5. with splitter.add_slot('before'):
  6. ui.label('This is some content on the left hand side.')
  7. with splitter.add_slot('after'):
  8. ui.label('This is some content on the right hand side.')
  9. ui.label().bind_text_from(splitter, 'value')
  10. screen.open('/')
  11. screen.should_contain('50')
  12. screen.should_contain("This is some content on the left hand side.")
  13. screen.should_contain("This is some content on the right hand side.")
  14. # Not sure how to programmatically move splitter
  15. # screen.should_contain('70')