test_link.py 610 B

12345678910111213141516171819
  1. from nicegui import ui
  2. from .screen import Screen
  3. def test_local_target_linking_on_sub_pages(screen: Screen):
  4. '''The issue arose when using <base> tag for reverse-proxy path handling. See https://github.com/zauberzeug/nicegui/pull/188#issuecomment-1336313925'''
  5. @ui.page('/sub')
  6. def main():
  7. ui.link('goto target', f'#target').style('margin-bottom: 600px')
  8. ui.link_target('target')
  9. ui.label('the target')
  10. ui.label('main page')
  11. screen.open('/sub')
  12. screen.click('goto target')
  13. screen.should_contain('the target')
  14. screen.should_not_contain('main page')