@@ -27,6 +27,43 @@ def change_description(obj):
2727 assert_solara_snapshot (page_session .locator ("text=Tested event" ).screenshot (), postfix = "-ipyvuetify3" if solara .util .ipyvuetify_major_version == 3 else "" )
2828
2929
30+ def test_widget_ipyaggrid (solara_test , page_session : playwright .sync_api .Page ):
31+ # ipyaggrid >=0.5.2 uses the data-base-url on body
32+ # introduced in https://github.com/widgetti/ipyaggrid/pull/64
33+ # which we broke in https://github.com/widgetti/solara/pull/805 since
34+ # we changed the nbextensions path, but didn't update the data-base-url
35+ import ipyaggrid
36+
37+ cars = [
38+ {"carName" : "Chevelle" , "origin" : "US" , "make" : "Chevrolet" , "price" : 30415 },
39+ {"carName" : "Skylark 320" , "origin" : "US" , "make" : "Buick" , "price" : 21042 },
40+ {"carName" : "PL411" , "origin" : "Asia" , "make" : "Datsun" , "price" : 27676 },
41+ ]
42+ column_defs = [{"field" : c } for c in cars [0 ]]
43+
44+ grid_options = {
45+ "columnDefs" : column_defs ,
46+ }
47+ g = ipyaggrid .Grid (grid_data = cars , grid_options = grid_options )
48+
49+ watermark_detected = False
50+
51+ def log (msg ):
52+ if "All AG Grid Enterprise features are unlocked" in msg .text :
53+ nonlocal watermark_detected
54+ watermark_detected = True
55+
56+ page_session .on ("console" , log )
57+
58+ display (g )
59+
60+ cell = page_session .locator (".ag-root-wrapper >> text=Chevrolet" )
61+ cell .click ()
62+ cell .wait_for ()
63+ assert watermark_detected
64+ page_session .remove_listener ("console" , log )
65+
66+
3067def test_solara_button_all (ipywidgets_runner , page_session : playwright .sync_api .Page , request , assert_solara_snapshot ):
3168 if request .node .callspec .params ["ipywidgets_runner" ] != "solara" and request .node .callspec .params ["solara_server" ] != SERVERS [0 ]:
3269 pytest .skip ("No need to run this test for all servers." )
0 commit comments