Skip to content

Commit

Permalink
fix tests, we use v1/ now.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Mar 5, 2024
1 parent f1a1285 commit 6cfa0d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/trailblazer/pro/editor/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def retrieve_document(ctx, session:, diagram_slug:, **)
id_token = session.id_token

ctx[:response] = response = Faraday.get(
"#{session.trailblazer_pro_host}/api/v2/diagrams/#{diagram_slug}/export",
"#{session.trailblazer_pro_host}/api/v1/diagrams/#{diagram_slug}/export",
{},
{'Content-Type'=>'application/json', "Accept": "application/json",
"Authorization": "Bearer #{id_token}"
Expand Down
4 changes: 3 additions & 1 deletion test/api_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "test_helper"

class ApiTest < Minitest::Spec
after { `rm -r test/imported_json/*json` }
after { `rm tmp/b0f945.json` }

it "we can import a collaboration in our PRO JSON format" do
Trailblazer::Pro.initialize!(api_key: api_key, trailblazer_pro_host: trailblazer_pro_host)
Expand All @@ -21,6 +21,8 @@ class ApiTest < Minitest::Spec
{}
])

assert_equal signal.inspect, %(#<Trailblazer::Activity::End semantic=:success>)

assert_equal File.read("/tmp/b0f945.json"), %({\"id\":3,\"type\":\"collaboration\",\"lanes\":[{\"id\":\"lifecycle\",\"type\":\"lane\",\"elements\":[{\"id\":\"Activity_0dgrwre\",\"label\":\"Create\",\"type\":\"task\",\"data\":{},\"links\":[{\"target_id\":\"throw-after-Activity_0dgrwre\",\"semantic\":\"success\"}]},{\"id\":\"catch-before-Activity_0dgrwre\",\"label\":null,\"type\":\"catch_event\",\"data\":{\"start_task\":true},\"links\":[{\"target_id\":\"Activity_0dgrwre\",\"semantic\":\"success\"}]},{\"id\":\"throw-after-Activity_0dgrwre\",\"label\":null,\"type\":\"throw_event\",\"data\":{},\"links\":[]},{\"id\":\"suspend-gw-to-catch-before-Activity_0dgrwre\",\"label\":null,\"type\":\"suspend\",\"data\":{\"resumes\":[\"catch-before-Activity_0dgrwre\"]},\"links\":[]}]}],\"messages\":[]}) # a particular eloquent diagram.
end

Expand Down

0 comments on commit 6cfa0d0

Please sign in to comment.