Skip to content

Commit

Permalink
fix tests with new JSON fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Mar 23, 2024
1 parent 862021e commit 4306592
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/discovery_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DiscoveryTest < Minitest::Spec
lanes: lanes_cfg

assert_position_after states[14][:suspend_configuration],
["suspend-Gateway_1kl7pnm", "suspend-Gateway_1g3fhu2", "End.success"],
["suspend-Gateway_1kl7pnm", "suspend-Gateway_00n4dsm", "End.success"],
lanes: lanes_cfg

assert_nil states[15]
Expand All @@ -155,7 +155,7 @@ class DiscoveryTest < Minitest::Spec
iteration_set = Trailblazer::Workflow::Introspect::Iteration::Set.from_discovered_states(states, lanes_cfg: lanes_cfg)

testing_json = JSON.pretty_generate(Trailblazer::Workflow::Introspect::Iteration::Set::Serialize.(iteration_set, lanes_cfg: lanes_cfg))
# File.write "test/iteration_json.json", testing_json
# File.write("test/iteration_json.json", testing_json)
assert_equal testing_json, File.read("test/iteration_json.json")

iteration_set_from_json = Trailblazer::Workflow::Introspect::Iteration::Set::Deserialize.(JSON.parse(testing_json), lanes_cfg: lanes_cfg)
Expand Down Expand Up @@ -273,7 +273,7 @@ class DiscoveryTestPlanTest < Minitest::Spec
| ☝ ⏵︎Delete | ⛾ ⏵︎Publish ⏵︎Delete ⏵︎Update ☝ ⏵︎Delete ⏵︎Cancel ☑ ◉End.failure | ⛾ ◉End.success ☝ ◉End.success ☑ ◉End.failure |
| ☝ ⏵︎Cancel | ⛾ ⏵︎Publish ⏵︎Delete ⏵︎Update ☝ ⏵︎Delete ⏵︎Cancel ☑ ◉End.failure | ⛾ ⏵︎Publish ⏵︎Delete ⏵︎Update ☝ ⏵︎Update form ⏵︎Delete? form ⏵︎Publish ☑ ◉End.failure |
| ☝ ⏵︎Archive | ⛾ ⏵︎Archive ☝ ⏵︎Archive ☑ ◉End.failure | ⛾ ◉End.success ☝ ◉End.success ☑ ◉End.failure |
| ☝ ⏵︎Revise | ⛾ ⏵︎Revise ☝ ⏵︎Revise ☑ ◉End.success | ⛾ ⏵︎Revise ⏵︎Notify approver ☝ ⏵︎Update form ⏵︎Notify approver ☑ ◉End.success |
| ☝ ⏵︎Revise | ⛾ ⏵︎Revise ☝ ⏵︎Revise ☑ ◉End.success | ⛾ ⏵︎Revise ⏵︎Notify approver ☝ ⏵︎Revise form ⏵︎Notify approver ☑ ◉End.success |
+----------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+)
end
end
Expand Down
9 changes: 8 additions & 1 deletion test/generate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class GenerateTest < Minitest::Spec
data={:type=>:catch_event, :label=>"valid?"}>=>
[#<struct Trailblazer::Activity::Schema::Intermediate::Out
semantic=:success,
target="suspend-Gateway_1g3fhu2">],
target="suspend-Gateway_00n4dsm">],
#<struct Trailblazer::Activity::Schema::Intermediate::TaskRef
id="Event_1wly6jj",
data={:type=>:catch_event, :label=>"invalid?"}>=>
Expand Down Expand Up @@ -674,6 +674,12 @@ class GenerateTest < Minitest::Spec
{"resumes"=>
["catch-before-Activity_1165bw9", "catch-before-Activity_1dt5di5"],
:type=>:suspend}>=>[],
#<struct Trailblazer::Activity::Schema::Intermediate::TaskRef
id="suspend-Gateway_00n4dsm",
data=
{"resumes"=>
["catch-before-Activity_0zsock2", "catch-before-Activity_1dt5di5"],
:type=>:suspend}>=>[],
#<struct Trailblazer::Activity::Schema::Intermediate::TaskRef
id="suspend-gw-to-Event_1vrfxsv",
data={"resumes"=>["Event_1vrfxsv"], :type=>:suspend}>=>[],
Expand Down Expand Up @@ -706,6 +712,7 @@ class GenerateTest < Minitest::Spec
"suspend-Gateway_14h0q7a"=>:suspend,
"suspend-Gateway_1d05yki"=>:suspend,
"suspend-Gateway_0kknfje"=>:suspend,
"suspend-Gateway_00n4dsm"=>:suspend,
"suspend-gw-to-Event_1vrfxsv"=>:suspend,
"suspend-gw-to-Event_0j1jua6"=>:suspend,
"suspend-gw-to-Event_19ha0ea"=>:suspend,
Expand Down

0 comments on commit 4306592

Please sign in to comment.