Skip to content

Commit d574862

Browse files
committed
Rename test
1 parent 3a99744 commit d574862

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Auth/src/commonTest/kotlin/UtilsTest.kt renamed to Auth/src/commonTest/kotlin/UrlUtilsTest.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import io.github.jan.supabase.auth.consumeHashParameters
22
import io.github.jan.supabase.auth.consumeUrlParameter
3+
import io.github.jan.supabase.auth.redirectTo
4+
import io.ktor.client.request.HttpRequestBuilder
5+
import io.ktor.client.request.url
36
import kotlin.test.Test
47
import kotlin.test.assertEquals
58

6-
class UtilsTest {
9+
class UrlUtilsTest {
710

811
@Test
912
fun testConsumeHashParameters() {
@@ -21,4 +24,16 @@ class UtilsTest {
2124
assertEquals(expectedUrl, newUrl)
2225
}
2326

27+
@Test
28+
fun testRedirectTo() {
29+
val url = "https://example.com/"
30+
val redirectTo = "https://redirect.com"
31+
val newUrl = HttpRequestBuilder().apply {
32+
url(url)
33+
redirectTo(redirectTo)
34+
}.url.toString()
35+
val expectedUrl = "https://example.com/?redirect_to=https%3A%2F%2Fredirect.com"
36+
assertEquals(expectedUrl, newUrl)
37+
}
38+
2439
}

0 commit comments

Comments
 (0)