File tree Expand file tree Collapse file tree 3 files changed +38
-6
lines changed
tests/integration/callbacks Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -302,12 +302,19 @@ const observer: IStoreObserverDefinition<IStoreState> = {
302
302
}
303
303
304
304
if ( error !== undefined ) {
305
- const outputs = payload
306
- ? map ( combineIdAndProp , flatten ( [ payload . outputs ] ) ) . join (
307
- ', '
308
- )
309
- : output ;
310
- let message = `Callback error updating ${ outputs } ` ;
305
+ let message ;
306
+ if ( cb . callback . no_output ) {
307
+ const inpts = keys ( cb . changedPropIds ) . join ( ', ' ) ;
308
+ message = `Callback error with no output from input ${ inpts } ` ;
309
+ } else {
310
+ const outputs = payload
311
+ ? map (
312
+ combineIdAndProp ,
313
+ flatten ( [ payload . outputs ] )
314
+ ) . join ( ', ' )
315
+ : output ;
316
+ message = `Callback error updating ${ outputs } ` ;
317
+ }
311
318
if ( clientside_function ) {
312
319
const { namespace : ns , function_name : fn } =
313
320
clientside_function ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export interface ICallbackDefinition {
14
14
long ?: LongCallbackInfo ;
15
15
dynamic_creator ?: boolean ;
16
16
running : any ;
17
+ no_output ?: boolean ;
17
18
}
18
19
19
20
export interface ICallbackProperty {
Original file line number Diff line number Diff line change @@ -141,3 +141,27 @@ def on_click(n_clicks):
141
141
142
142
dash_duo .wait_for_element ("#click" ).click ()
143
143
dash_duo .wait_for_text_to_equal ("#output" , "Clicked 1 times" )
144
+
145
+
146
+ def test_arb005_no_output_error (dash_duo ):
147
+ app = Dash ()
148
+
149
+ app .layout = html .Div ([html .Button ("start" , id = "start" )])
150
+
151
+ @app .callback (Input ("start" , "n_clicks" ), prevent_initial_call = True )
152
+ def on_click (clicked ):
153
+ return f"clicked { clicked } "
154
+
155
+ dash_duo .start_server (
156
+ app ,
157
+ debug = True ,
158
+ use_reloader = False ,
159
+ use_debugger = True ,
160
+ dev_tools_hot_reload = False ,
161
+ )
162
+
163
+ dash_duo .wait_for_element ("#start" ).click ()
164
+ dash_duo .wait_for_text_to_equal (
165
+ ".dash-fe-error__title" ,
166
+ "Callback error with no output from input start.n_clicks" ,
167
+ )
You can’t perform that action at this time.
0 commit comments