dash icon indicating copy to clipboard operation
dash copied to clipboard

dash-testing, mocking callback context, keys and multiple context data

Open martinschorb opened this issue 1 year ago • 0 comments

Dear all,

I have a callback with a dynamic set of inputs. I thus use ctx.inputs or ctx.inputs_list to capture which elements are available.

In the dash-testing documentation, it is well explained how the triggered context can be generated using context_value.set.

However, I run into the following issue:

It is not clear to me how the dictionary keys provided to context_value.set map to those of dash.callback_context.

It seems that what is shown in the example, the key triggered_inputs affects all of the ctx.triggered, ctx.triggered_prop_ids, ctx.triggered_id attributes.

  • How can I set ctx.inputs and ctx.inputs_list and their equivalents for states accordingly using context_value.set?
  • Is this currently possible?
  • In addition, is it possible to provide multiple attributes at once to context_value.set to for example set both triggered and states_list attributes?

martinschorb avatar Aug 24 '22 15:08 martinschorb