mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Fix flaky tests
This commit is contained in:
@@ -104,16 +104,25 @@ defmodule Domain.Auth.Adapters.OpenIDConnectTest do
|
||||
assert {:ok, authorization_uri, {state, verifier}} =
|
||||
authorization_uri(provider, "https://example.com/")
|
||||
|
||||
assert authorization_uri ==
|
||||
"http://localhost:#{bypass.port}/authorize" <>
|
||||
"?access_type=offline" <>
|
||||
"&client_id=#{provider.adapter_config["client_id"]}" <>
|
||||
"&code_challenge=#{Domain.Auth.Adapters.OpenIDConnect.PKCE.code_challenge(verifier)}" <>
|
||||
"&code_challenge_method=S256" <>
|
||||
"&redirect_uri=https%3A%2F%2Fexample.com%2F" <>
|
||||
"&response_type=code" <>
|
||||
"&scope=openid+email+profile" <>
|
||||
"&state=#{state}"
|
||||
uri = URI.parse(authorization_uri)
|
||||
uri_query = URI.decode_query(uri.query)
|
||||
|
||||
assert uri.scheme == "http"
|
||||
assert uri.host == "localhost"
|
||||
assert uri.port == bypass.port
|
||||
assert uri.path == "/authorize"
|
||||
|
||||
assert uri_query == %{
|
||||
"access_type" => "offline",
|
||||
"client_id" => provider.adapter_config["client_id"],
|
||||
"code_challenge" =>
|
||||
Domain.Auth.Adapters.OpenIDConnect.PKCE.code_challenge(verifier),
|
||||
"code_challenge_method" => "S256",
|
||||
"redirect_uri" => "https://example.com/",
|
||||
"response_type" => "code",
|
||||
"scope" => "openid email profile",
|
||||
"state" => state
|
||||
}
|
||||
|
||||
assert is_binary(state)
|
||||
assert is_binary(verifier)
|
||||
|
||||
@@ -217,7 +217,7 @@ defmodule Web.AuthControllerTest do
|
||||
"/#{account.id}/sign_in/providers/#{provider.id}/verify_sign_in_token"
|
||||
|
||||
assert email.text_body =~ "#{verify_sign_in_token_path}"
|
||||
assert email.text_body =~ "identity_id=#{identity.id}&secret="
|
||||
assert email.text_body =~ "identity_id=#{identity.id}"
|
||||
assert email.text_body =~ "secret="
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user