Skip to content

Commit

Permalink
test that flow_options is passed through #advance properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Mar 18, 2024
1 parent 431be14 commit e3fa1e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/trailblazer/workflow/advance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def advance((ctx, flow_options), **circuit_options)
# FIXME: fix flow_options!

configuration, (ctx, flow_options) = Trailblazer::Workflow::Collaboration::Synchronous.advance(
[ctx, {throw: []}.merge(flow_options)], # FIXME: allow flow_options, AND TEST IT PROPERLY and circuit_options!!!!!!!!!!!!!!!!!!!!!!!!!!
[ctx, {throw: []}.merge(flow_options)], # FIXME: allow circuit_options?
circuit_options, # circuit_options

**position_options,
Expand Down
5 changes: 5 additions & 0 deletions test/advance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def render(text)
Trailblazer::Endpoint::Runtime.({params: {}, seq: []}, adapter: action_adapter_with_model, default_matcher: default_matcher, matcher_context: self, flow_options: flow_options, &matcher_block)
assert_equal @render, %(404 not found: )

# {flow_options} is passed correctly through the entire run.
flow_options = original_flow_options.merge(event_label: "☝ ⏵︎Update",)
signal, (ctx, flow_options) = Trailblazer::Endpoint::Runtime.({params: {id: 1}, seq: []}, adapter: action_adapter_with_model, default_matcher: default_matcher, matcher_context: self, flow_options: flow_options, &matcher_block)
assert_equal flow_options[:event_label], "☝ ⏵︎Update"

# advance "☝ ⏵︎Create" do |ctx|

# end.Or() do |ctx|
Expand Down

0 comments on commit e3fa1e3

Please sign in to comment.