MCPcopy
hub / github.com/plotly/dash / test_rdps005_persisted_props

Function test_rdps005_persisted_props

tests/integration/renderer/test_persistence.py:211–238  ·  view source on GitHub ↗
(dash_duo)

Source from the content-addressed store, hash-verified

209
210@flaky.flaky(max_runs=3)
211def test_rdps005_persisted_props(dash_duo):
212 app = Dash(__name__)
213 app.layout = html.Div(
214 [
215 html.Button("toggle persisted_props", id="toggle-table"),
216 html.Div(id="container"),
217 ]
218 )
219
220 @app.callback(Output("container", "children"), [Input("toggle-table", "n_clicks")])
221 def toggle_table(n):
222 if (n or 0) % 2:
223 return simple_table(persisted_props=["data", "columns.name"])
224 return simple_table()
225
226 dash_duo.start_server(app)
227 check_table_names(dash_duo, ["a", "b"])
228
229 rename_and_hide(dash_duo)
230 check_table_names(dash_duo, [NEW_NAME])
231
232 dash_duo.find_element("#toggle-table").click()
233 # hidden_columns not persisted
234 check_table_names(dash_duo, [NEW_NAME, "b"])
235
236 dash_duo.find_element("#toggle-table").click()
237 # back to original persisted_props hidden_columns returns
238 check_table_names(dash_duo, [NEW_NAME])
239
240
241def test_rdps006_move_on_page(dash_duo):

Callers

nothing calls this directly

Calls 6

DashClass · 0.90
check_table_namesFunction · 0.85
rename_and_hideFunction · 0.85
find_elementMethod · 0.80
start_serverMethod · 0.45
clickMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…