File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
firebase-auth/src/commonTest/kotlin/dev/gitlive/firebase/auth Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ package dev.gitlive.firebase.auth
7
7
import dev.gitlive.firebase.Firebase
8
8
import dev.gitlive.firebase.FirebaseOptions
9
9
import dev.gitlive.firebase.initialize
10
- import kotlinx.coroutines.GlobalScope
10
+ import kotlin.random.Random
11
11
import kotlin.test.BeforeTest
12
12
import kotlin.test.Test
13
13
import kotlin.test.assertEquals
14
+ import kotlin.test.assertNotEquals
14
15
15
16
expect val context: Any
16
17
expect fun runTest (test : suspend () -> Unit )
@@ -36,4 +37,14 @@ class FirebaseAuthTest {
36
37
val result
= Firebase .auth.signInWithEmailAndPassword(
" [email protected] " ,
" test123" )
37
38
assertEquals(" mn8kgIFnxLO7il8GpTa5g0ObP6I2" , result.user!! .uid)
38
39
}
39
- }
40
+
41
+ @Test
42
+ fun testCreateUserWithEmailAndPassword () = runTest {
43
+ val email = " test+${Random .nextInt(100000 )} @test.com"
44
+ val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
45
+ assertNotEquals(null , createResult.user?.uid)
46
+
47
+ val signInResult = Firebase .auth.signInWithEmailAndPassword(email, " test123" )
48
+ assertEquals(createResult.user?.uid, signInResult.user?.uid)
49
+ }
50
+ }
You can’t perform that action at this time.
0 commit comments