Skip to content

Commit

Permalink
chore(IntegrationTests): add JsName to properly support all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
benjohnde committed Aug 21, 2020
1 parent 1bb9aed commit 8684dd9
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.liftric.base.Environment
import kotlinx.coroutines.delay
import kotlin.test.*
import kotlinx.coroutines.*
import kotlin.js.JsName

class AuthHandlerIntegrationTests() {
private val configuration = Configuration(
Expand Down Expand Up @@ -58,6 +59,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("SignUpSignInDeleteUserTest")
@Test
fun `Sign up, sign in, delete user should succeed`() = runBlocking {
authHandler.signUp(
Expand Down Expand Up @@ -85,6 +87,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("GetUserTest")
@Test
fun `Should get user`() = runBlocking {
var token: String = ""
Expand All @@ -98,6 +101,7 @@ class AuthHandlerIntegrationTests() {
deleteUser(token)
}

@JsName("ChangeEmailTest")
@Test
fun `Should change email`() = runBlocking {
var token: String = ""
Expand All @@ -124,6 +128,7 @@ class AuthHandlerIntegrationTests() {
deleteUser(token)
}

@JsName("ChangePasswordTest")
@Test
fun `Should change password`() = runBlocking {
var token: String = ""
Expand All @@ -149,6 +154,7 @@ class AuthHandlerIntegrationTests() {
deleteUser(accessToken)
}

@JsName("SignOutSignInTest")
@Test
fun `Sign out and sign in should succeed`() = runBlocking {
var token: String = ""
Expand All @@ -171,6 +177,7 @@ class AuthHandlerIntegrationTests() {
deleteUser(accessToken)
}

@JsName("SignUpFailPasswordTooShortTest")
@Test
fun `Sign up should fail because password too short`() = runBlocking {
authHandler.signUp(
Expand All @@ -189,6 +196,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("SignUpFailPasswordTooLongTest")
@Test
fun `Sign up should fail because password too long`() = runBlocking {
authHandler.signUp(
Expand All @@ -207,6 +215,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("SignUpFailUsernameTooLongTest")
@Test
fun `Sign up should fail because username too long`() = runBlocking {
authHandler.signUp(
Expand All @@ -225,6 +234,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("SignInTest")
@Test
fun `Sign in should fail because wrong credentials`() = runBlocking {
authHandler.signIn(
Expand All @@ -236,6 +246,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("DeleteUserFailTest")
@Test
fun `Get user should fail since access token wrong`() = runBlocking {
authHandler.deleteUser("WRONG_TOKEN") { error ->
Expand All @@ -244,6 +255,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("DeleteUserTest")
@Test
fun `Delete user should fail since access token wrong`() = runBlocking {
authHandler.deleteUser("WRONG_TOKEN") { error ->
Expand All @@ -252,6 +264,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("SignOutTest")
@Test
fun `Sign out should fail since access token wrong`() = runBlocking {
authHandler.signOut("WRONG_TOKEN") { error ->
Expand All @@ -260,6 +273,7 @@ class AuthHandlerIntegrationTests() {
}
}

@JsName("UpdateUserAttributesTest")
@Test
fun `Update attributes should fail since access token wrong`() = runBlocking {
authHandler.updateUserAttributes(
Expand Down

0 comments on commit 8684dd9

Please sign in to comment.