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

Function test_hook009_hook_clientside_callback

tests/integration/test_hooks.py:175–192  ·  view source on GitHub ↗
(hook_cleanup, dash_duo)

Source from the content-addressed store, hash-verified

173
174
175def test_hook009_hook_clientside_callback(hook_cleanup, dash_duo):
176 hooks.clientside_callback(
177 "(n) => `Called ${n}`",
178 Output("hook-output", "children"),
179 Input("hook-start", "n_clicks"),
180 prevent_initial_call=True,
181 )
182
183 app = Dash()
184 app.layout = [
185 html.Button("start", id="hook-start"),
186 html.Div(id="hook-output"),
187 ]
188
189 dash_duo.start_server(app)
190
191 dash_duo.wait_for_element("#hook-start").click()
192 dash_duo.wait_for_text_to_equal("#hook-output", "Called 1")
193
194
195def test_hook010_hook_custom_data(hook_cleanup, dash_duo):

Callers

nothing calls this directly

Calls 8

OutputClass · 0.90
InputClass · 0.90
DashClass · 0.90
wait_for_elementMethod · 0.80
clientside_callbackMethod · 0.45
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…