Skip to content

Commit

Permalink
little cleanup in Testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Jan 30, 2024
1 parent bd0f50e commit ca7d8ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/trailblazer/workflow/state/discovery/testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Testing
# DISCUSS: In the Testing JSON, we want
# 1. start event, start configuration, input => expected suspend configuration
# 2. a "comment" table above that which draws out the same in readable format.
def self.render_json(states, lanes:, additional_state_data:, initial_lane_positions:, task_map:)
def self.render_structure(states, lanes:, additional_state_data:, task_map:)
present_states = Trailblazer::Workflow::State::Discovery.generate_from(states) # returns rows with [{activity, suspend, resumes}]

# FIXME: we're actually going through events here, not states!
Expand All @@ -33,7 +33,6 @@ def self.render_json(states, lanes:, additional_state_data:, initial_lane_positi
serialized_start_configuration = start_configuration.collect do |position|
next if position.nil? # FIXME: what the hecke is this?

puts "@@@@@ #{position.inspect}"
position = position.values # FIXME: {Position} interface

serialize_lane_position(position, lanes: lanes)
Expand Down
5 changes: 3 additions & 2 deletions test/collaboration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,16 @@ def render_states(states, lanes:, additional_state_data:, task_map:)
This event is possible because process_model is in configuration ABC ("state")
=end
testing_json = Trailblazer::Workflow::State::Discovery::Testing.render_json(
testing_json = Trailblazer::Workflow::State::Discovery::Testing.render_structure(
states,
lanes: {lane_activity => "lifecycle", lane_activity_ui => "UI", approver_activity => "approver"},
initial_lane_positions: extended_initial_lane_positions, # DISCUSS: so we know what not to find via Introspect.
task_map: task_map,
additional_state_data: additional_state_data,
)




testing_json = JSON.pretty_generate(testing_json)
# File.write "test/discovery_testing_json.json", testing_json
File.write "test/discovery_testing_json.json", testing_json
Expand Down

0 comments on commit ca7d8ec

Please sign in to comment.