From c9555b07f8e52dfe779484c3a1de78dd295cd284 Mon Sep 17 00:00:00 2001 From: Nick Sutterer Date: Fri, 19 Apr 2024 17:14:42 +0200 Subject: [PATCH] fix all tests. --- test/discover_task_test.rb | 18 +++++------------- test/lane_test.rb | 4 +--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/test/discover_task_test.rb b/test/discover_task_test.rb index cd50e1f..1a9c093 100644 --- a/test/discover_task_test.rb +++ b/test/discover_task_test.rb @@ -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: " author workflow", - - # DISCUSS: compute this automatically/from diagram? - # TODO: how to get this from CLI? - lane_hints: { - " 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: { - [" 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. - [" author workflow", "Update"] => {ctx_merge: {:"article moderation:Update" => Trailblazer::Activity::Left}, config_payload: {outcome: :failure}}, - [" 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", diff --git a/test/lane_test.rb b/test/lane_test.rb index df18e55..24c4b2d 100644 --- a/test/lane_test.rb +++ b/test/lane_test.rb @@ -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