MCPcopy Index your code
hub / github.com/plotly/dash / test_clsd006_PreventUpdate

Function test_clsd006_PreventUpdate

tests/integration/clientside/test_clientside.py:232–273  ·  view source on GitHub ↗
(dash_duo)

Source from the content-addressed store, hash-verified

230
231
232def test_clsd006_PreventUpdate(dash_duo):
233 app = Dash(__name__, assets_folder="assets")
234
235 app.layout = html.Div(
236 [
237 dcc.Input(id="first", value=1),
238 dcc.Input(id="second", value=1),
239 dcc.Input(id="third", value=1),
240 ]
241 )
242
243 app.clientside_callback(
244 ClientsideFunction(namespace="clientside", function_name="add1_prevent_at_11"),
245 Output("second", "value"),
246 [Input("first", "value")],
247 [State("second", "value")],
248 )
249
250 app.clientside_callback(
251 ClientsideFunction(namespace="clientside", function_name="add1_prevent_at_11"),
252 Output("third", "value"),
253 [Input("second", "value")],
254 [State("third", "value")],
255 )
256
257 dash_duo.start_server(app)
258
259 dash_duo.wait_for_text_to_equal("#first", "1")
260 dash_duo.wait_for_text_to_equal("#second", "2")
261 dash_duo.wait_for_text_to_equal("#third", "2")
262
263 dash_duo.find_element("#first").send_keys("1")
264
265 dash_duo.wait_for_text_to_equal("#first", "11")
266 dash_duo.wait_for_text_to_equal("#second", "2")
267 dash_duo.wait_for_text_to_equal("#third", "2")
268
269 dash_duo.find_element("#first").send_keys("1")
270
271 dash_duo.wait_for_text_to_equal("#first", "111")
272 dash_duo.wait_for_text_to_equal("#second", "3")
273 dash_duo.wait_for_text_to_equal("#third", "3")
274
275
276def test_clsd007_no_update(dash_duo):

Callers

nothing calls this directly

Calls 10

clientside_callbackMethod · 0.95
DashClass · 0.90
ClientsideFunctionClass · 0.90
OutputClass · 0.90
InputClass · 0.90
StateClass · 0.90
send_keysMethod · 0.80
find_elementMethod · 0.80
start_serverMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…