Skip to content

Commit

Permalink
fix all tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Apr 19, 2024
1 parent 8b195cc commit c9555b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 5 additions & 13 deletions test/discover_task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ class DiscoverTaskTest < Minitest::Spec
it "Discovery task: discover, serialize, create test plan, create state table/state guards" do
Dir.chdir(TEST_ROOT) do
Trailblazer::Workflow::Task::Discover.(
json_filename: "../fixtures/v1/posting-v10.json",
start_lane: "<ui> author workflow",

# DISCUSS: compute this automatically/from diagram?
# TODO: how to get this from CLI?
lane_hints: {
"<ui> author workflow" => {label: "UI", icon: "☝"},
"article moderation" => {label: "lifecycle", icon: "⛾"},
"reviewer" => {label: "editor", icon: "☑"},
},
json_filename: "../fixtures/v1/posting-v11.json",
start_lane: "UI",

dsl_options_for_run_multiple_times: {
["<ui> author workflow", "Create"] => {ctx_merge: {:"article moderation:Create" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
["UI", "Create"] => {ctx_merge: {:"⛾.lifecycle.posting:Create" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
# Click [UI Update] again, with invalid data.
["<ui> author workflow", "Update"] => {ctx_merge: {:"article moderation:Update" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
["<ui> author workflow", "Revise"] => {ctx_merge: {:"article moderation:Revise" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
["UI", "Update"] => {ctx_merge: {:"⛾.lifecycle.posting:Update" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
["UI", "Revise"] => {ctx_merge: {:"⛾.lifecycle.posting:Revise" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}},
},

namespace: "Posting::Collaboration",
Expand Down
4 changes: 1 addition & 3 deletions test/lane_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def update_with_circuit_interface((ctx, flow_options), **)
it "produces a runnable Activity with (Collaboration.Lane)" do
implementing = T.def_steps(:create, :notify_approver, :reject, :accept, :revise, :publish, :archive, :delete)

moderation_json = File.read("test/fixtures/v1/moderation.json")

signal, (ctx, _) = Trailblazer::Workflow::Generate.invoke([{json_document: moderation_json}, {}])
signal, (ctx, _) = Trailblazer::Workflow::Collaboration::Structure.invoke([{json_filename: "test/fixtures/v1/moderation.json"}, {}])

article_moderation_intermediate = ctx[:intermediates]["article moderation"]
# pp article_moderation_intermediate
Expand Down

0 comments on commit c9555b0

Please sign in to comment.