浏览代码

#206: provide test to reproduce the problem

Rodja Trappe 2 年之前
父节点
当前提交
f4d2a52e17
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      tests/test_element.py

+ 11 - 0
tests/test_element.py

@@ -126,3 +126,14 @@ def test_remove_and_clear(screen: Screen):
     screen.should_not_contain('Label A')
     screen.should_not_contain('Label B')
     screen.should_not_contain('Label C')
+
+
+def test_setting_visibility_in_timer(screen: Screen):
+    '''reproduction of https://github.com/zauberzeug/nicegui/issues/206'''
+    @ui.page('/')
+    def page():
+        label = ui.label('Invisible')
+        ui.timer(1, lambda: label.set_visibility(False))
+
+    screen.open('/')
+    screen.should_not_contain('Invisible')