Skip to content

Commit

Permalink
Added audit logs list integration test. Ignoring as there is no abili…
Browse files Browse the repository at this point in the history
…ty to test it
  • Loading branch information
a2xchip committed Jan 22, 2025
1 parent b49dd56 commit a389319
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/integrationTest/kotlin/OrganizationsIntegrationTest.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.jeliuc.turso.sdk

import com.jeliuc.turso.sdk.model.ListAuditLogsResponse
import com.jeliuc.turso.sdk.model.ListInvitesResponse
import com.jeliuc.turso.sdk.resource.organizations
import io.ktor.client.engine.cio.CIO
import kotlinx.coroutines.runBlocking
import kotlin.test.Ignore
import kotlin.test.Test
import kotlin.test.assertIs

Expand All @@ -18,13 +20,24 @@ class OrganizationsIntegrationTest {

@Test
fun `can list invitations`() {
val client = TursoClient.using(CIO.create(), token)

val invitations =
runBlocking {
client.organizations.invites.list(organization)
getClient().organizations.invites.list(organization)
}

assertIs<ListInvitesResponse>(invitations)
}

@Test
@Ignore("The free plan we currently use doesn't support this endpoint")
fun `can list audit logs`() {
val logs =
runBlocking {
getClient().organizations.auditLogs.list(organization)
}

assertIs<ListAuditLogsResponse>(logs)
}

private fun getClient(): TursoClient = TursoClient.using(CIO.create(), token)
}

0 comments on commit a389319

Please sign in to comment.