File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from nicegui import ui
55from .screen import BrowserManager
66from playwright .sync_api import expect , Locator , Page
7- from nicegui_tabulator import tabulator , CellSlotProps
7+ from nicegui_tabulator import tabulator , CellSlotProps , import_luxon
88import pandas as pd
99
1010
@@ -939,3 +939,36 @@ def build_table():
939939
940940 body_expect = expect (page .locator ("body" ))
941941 body_expect .to_contain_text ("works" )
942+
943+
944+ def test_import_luxon (browser : BrowserManager , page_path : str ):
945+ @ui .page (page_path )
946+ def _ ():
947+ import_luxon ()
948+
949+ tabledata = [
950+ {"id" : 1 , "dob" : "1982-05-14" },
951+ {"id" : 2 , "dob" : "1999-01-31" },
952+ ]
953+
954+ table_config = {
955+ "data" : tabledata ,
956+ "columns" : [
957+ {
958+ "title" : "dob" ,
959+ "field" : "dob" ,
960+ "formatter" : "datetime" ,
961+ "formatterParams" : {
962+ "inputFormat" : "iso" ,
963+ "outputFormat" : "dd/MM/yyyy" ,
964+ },
965+ },
966+ ],
967+ }
968+
969+ tabulator (table_config ).classes ("target" )
970+
971+ page = browser .open (page_path )
972+ table = page .locator (".target" )
973+ expect (table ).to_be_visible ()
974+ check_table_rows (table , expected_data = [["14/05/1982" ], ["31/01/1999" ]])
You can’t perform that action at this time.
0 commit comments