소스 검색

add test_table

Falko Schindler 2 년 전
부모
커밋
a3b65cb496
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  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')