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

Function test_rdps006_move_on_page

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

Source from the content-addressed store, hash-verified

239
240
241def test_rdps006_move_on_page(dash_duo):
242 app = Dash(__name__)
243 app.layout = html.Div(
244 [html.Button("move table", id="move-table"), html.Div(id="container")]
245 )
246
247 @app.callback(Output("container", "children"), [Input("move-table", "n_clicks")])
248 def move_table(n):
249 children = [html.Div("div 0", id="div0"), simple_table()]
250 for i in range(1, (n or 0) + 1):
251 children = [
252 html.Div("div {}".format(i), id="div{}".format(i)),
253 html.Div(children),
254 ]
255 return children
256
257 def find_last_div(n):
258 dash_duo.wait_for_text_to_equal("#div{}".format(n), "div {}".format(n))
259 assert len(dash_duo.find_elements("#div{}".format(n + 1))) == 0
260
261 dash_duo.start_server(app)
262 find_last_div(0)
263 check_table_names(dash_duo, ["a", "b"])
264
265 rename_and_hide(dash_duo)
266 check_table_names(dash_duo, [NEW_NAME])
267
268 for i in range(1, 5):
269 dash_duo.find_element("#move-table").click()
270 find_last_div(i)
271 check_table_names(dash_duo, [NEW_NAME])
272
273
274def test_rdps007_one_prop_changed(dash_duo):

Callers

nothing calls this directly

Calls 7

DashClass · 0.90
find_last_divFunction · 0.85
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…