(dash_duo)
| 230 | |
| 231 | |
| 232 | def 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 | |
| 276 | def test_clsd007_no_update(dash_duo): |
nothing calls this directly
no test coverage detected
searching dependent graphs…