Ver Fonte

add test_table

Falko Schindler há 2 anos atrás
pai
commit
a3b65cb496
1 ficheiros alterados com 20 adições e 0 exclusões
  1. 20 0
      tests/test_table.py

+ 20 - 0
tests/test_table.py

@@ -0,0 +1,20 @@
+from nicegui import ui
+
+from .screen import Screen
+
+
+def test_update_table(screen: Screen):
+    table = ui.table({
+        'columnDefs': [{'field': 'name'}, {'field': 'age'}],
+        'rowData': [{'name': 'Alice', 'age': 18}],
+    })
+
+    screen.open('/')
+    screen.should_contain('Name')
+    screen.should_contain('Age')
+    screen.should_contain('Alice')
+    screen.should_contain('18')
+
+    table.options['rowData'][0]['age'] = 42
+    table.update()
+    screen.should_contain('42')