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

Function test_pch005_clientside_duplicate

tests/integration/test_patch.py:452–481  ·  view source on GitHub ↗
(dash_duo)

Source from the content-addressed store, hash-verified

450
451
452def test_pch005_clientside_duplicate(dash_duo):
453 app = Dash(__name__)
454
455 app.layout = html.Div(
456 [
457 html.Button("Click 1", id="click1"),
458 html.Button("Click 2", id="click2"),
459 html.Div("initial", id="output"),
460 ]
461 )
462
463 app.clientside_callback(
464 "function() { return 'click1';}",
465 Output("output", "children", allow_duplicate=True),
466 Input("click1", "n_clicks"),
467 prevent_initial_call=True,
468 )
469 app.clientside_callback(
470 "function() { return 'click2';}",
471 Output("output", "children", allow_duplicate=True),
472 Input("click2", "n_clicks"),
473 prevent_initial_call=True,
474 )
475 dash_duo.start_server(app)
476
477 dash_duo.find_element("#click1").click()
478 dash_duo.wait_for_text_to_equal("#output", "click1")
479
480 dash_duo.find_element("#click2").click()
481 dash_duo.wait_for_text_to_equal("#output", "click2")
482
483
484def test_pch006_base_operators(dash_duo):

Callers

nothing calls this directly

Calls 8

clientside_callbackMethod · 0.95
DashClass · 0.90
OutputClass · 0.90
InputClass · 0.90
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…