Skip to content

Commit 0d71611

Browse files
Added test to verify that dashboard does not crash when calling a non-existent component in the running keyword.
1 parent e1bbd62 commit 0d71611

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/integration/callbacks/test_basic_callback.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,3 +823,38 @@ def on_click(_):
823823

824824
dash_duo.wait_for_text_to_equal("#output", "done")
825825
dash_duo.wait_for_text_to_equal("#running", "off")
826+
827+
828+
def test_cbsc020_callback_running_non_existing_component(dash_duo):
829+
lock = Lock()
830+
app = Dash(__name__)
831+
832+
app.layout = html.Div(
833+
[
834+
html.Button("start", id="start"),
835+
html.Div(id="output"),
836+
]
837+
)
838+
839+
@app.callback(
840+
Output("output", "children"),
841+
Input("start", "n_clicks"),
842+
running=[
843+
[
844+
Output("non_existent_component", "children"),
845+
html.B("on", id="content"),
846+
"off",
847+
]
848+
],
849+
prevent_initial_call=True,
850+
)
851+
def on_click(_):
852+
with lock:
853+
pass
854+
return "done"
855+
856+
dash_duo.start_server(app)
857+
with lock:
858+
dash_duo.find_element("#start").click()
859+
860+
dash_duo.wait_for_text_to_equal("#output", "done")

0 commit comments

Comments
 (0)