From 056a80b7e0c0f6c1748d161f9df7657debe5a750 Mon Sep 17 00:00:00 2001 From: Jan Tennert Date: Sat, 11 Jan 2025 14:11:19 +0100 Subject: [PATCH] Fix tests --- Auth/src/commonTest/kotlin/AuthApiTest.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Auth/src/commonTest/kotlin/AuthApiTest.kt b/Auth/src/commonTest/kotlin/AuthApiTest.kt index e87b4238..f496fa71 100644 --- a/Auth/src/commonTest/kotlin/AuthApiTest.kt +++ b/Auth/src/commonTest/kotlin/AuthApiTest.kt @@ -319,6 +319,7 @@ class AuthRequestTest { val expectedRedirectUrl = "https://example.com" val expectedScopes = listOf("scope1", "scope2") val expectedUrlParams = mapOf("key" to "value") + val providerUrl = "https://example.com" val client = createMockedSupabaseClient(configuration = configuration) { val params = it.url.parameters assertEquals(expectedRedirectUrl, params["redirect_to"]) @@ -330,14 +331,19 @@ class AuthRequestTest { assertEquals(expectedScopes.joinToString(" "), params["scopes"]) assertEquals("value", params["key"]) respondJson( - sampleUserSession() + """ + { + "url": "$providerUrl" + } + """.trimIndent() ) } - client.auth.linkIdentity(expectedProvider, redirectUrl = expectedRedirectUrl) { + val url = client.auth.linkIdentity(expectedProvider, redirectUrl = expectedRedirectUrl) { scopes.addAll(expectedScopes) queryParams.putAll(expectedUrlParams) automaticallyOpenUrl = false } + assertEquals(providerUrl, url) } }