Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
rapterjet2004 2024-08-20 11:24:25 -05:00
parent 54a8b4224c
commit 85e3ccddd4
No known key found for this signature in database
GPG key ID: 3AA5FDFED7944099
2 changed files with 25 additions and 23 deletions

View file

@ -93,11 +93,11 @@ android {
buildConfigField "String", "PERMISSION_LOCAL_BROADCAST", "\"${localBroadcastPermission}\""
}
// testOptions {
// unitTests.all {
// useJUnitPlatform()
// }
// }
testOptions {
unitTests.all {
useJUnitPlatform()
}
}
buildTypes {
release {

View file

@ -7,6 +7,8 @@
*/
package com.nextcloud.talk.utils
import com.nextcloud.talk.data.user.model.User
import com.nextcloud.talk.models.domain.ConversationModel
import com.nextcloud.talk.models.json.capabilities.SpreedCapability
import com.nextcloud.talk.models.json.conversations.Conversation
import junit.framework.TestCase
@ -22,23 +24,23 @@ class ParticipantPermissionsTest : TestCase() {
ParticipantPermissions.JOIN_CALL or
ParticipantPermissions.DEFAULT
/**
* val attendeePermissions =
* ParticipantPermissions(
* spreedCapability,
* conversation
* )
*
* assert(attendeePermissions.canPublishScreen)
* assert(attendeePermissions.canJoinCall)
* assert(attendeePermissions.isDefault)
*
* assertFalse(attendeePermissions.isCustom)
* assertFalse(attendeePermissions.canStartCall())
* assertFalse(attendeePermissions.canIgnoreLobby())
* assertTrue(attendeePermissions.canPublishAudio())
* assertTrue(attendeePermissions.canPublishVideo())
*/
assertTrue(true)
val user = User()
user.id = 1
val attendeePermissions =
ParticipantPermissions(
spreedCapability,
ConversationModel.mapToConversationModel(conversation, user)
)
assert(attendeePermissions.canPublishScreen)
assert(attendeePermissions.canJoinCall)
assert(attendeePermissions.isDefault)
assertFalse(attendeePermissions.isCustom)
assertFalse(attendeePermissions.canStartCall())
assertFalse(attendeePermissions.canIgnoreLobby())
assertTrue(attendeePermissions.canPublishAudio())
assertTrue(attendeePermissions.canPublishVideo())
}
}