Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Jan 11, 2025
1 parent d7dd01a commit 056a80b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Auth/src/commonTest/kotlin/AuthApiTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand All @@ -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)
}
}

Expand Down

0 comments on commit 056a80b

Please sign in to comment.