Explorar o código

#206: provide test to reproduce the problem

Rodja Trappe %!s(int64=2) %!d(string=hai) anos
pai
achega
f4d2a52e17
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  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')