Adjust hub integration tests

This commit is contained in:
Jonatan Kłosko 2023-06-09 18:15:50 +02:00
parent 80423adcdf
commit ad7c1549e8

View file

@ -64,7 +64,7 @@ defmodule Livebook.TeamsTest do
describe "get_org_request_completion_data/1" do
test "returns the org data when it has been confirmed", %{node: node, user: user} do
teams_key = Teams.Org.teams_key()
key_hash = :crypto.hash(:sha256, teams_key)
key_hash = :crypto.hash(:sha256, teams_key) |> Base.url_encode64(padding: false)
org_request = :erpc.call(node, Hub.Integration, :create_org_request, [[key_hash: key_hash]])
org_request = :erpc.call(node, Hub.Integration, :confirm_org_request, [org_request, user])
@ -98,7 +98,7 @@ defmodule Livebook.TeamsTest do
test "returns the org request awaiting confirmation", %{node: node} do
teams_key = Teams.Org.teams_key()
key_hash = :crypto.hash(:sha256, teams_key)
key_hash = :crypto.hash(:sha256, teams_key) |> Base.url_encode64(padding: false)
org_request = :erpc.call(node, Hub.Integration, :create_org_request, [[key_hash: key_hash]])
@ -123,7 +123,7 @@ defmodule Livebook.TeamsTest do
now = NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
expires_at = NaiveDateTime.add(now, -5000)
teams_key = Teams.Org.teams_key()
key_hash = :crypto.hash(:sha256, teams_key)
key_hash = :crypto.hash(:sha256, teams_key) |> Base.url_encode64(padding: false)
org_request =
:erpc.call(node, Hub.Integration, :create_org_request, [