-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: black screen when last caller in a group #WPB-10652 (#3071)
* fix: black screen when last caller in a group #WPB-11117 * add tests * code format
- Loading branch information
1 parent
1f3c946
commit 8d3105b
Showing
2 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
logic/src/commonTest/kotlin/com/wire/kalium/logic/data/id/QualifiedIdTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import com.wire.kalium.logic.data.id.QualifiedID | ||
import kotlin.test.Test | ||
import kotlin.test.assertFalse | ||
import kotlin.test.assertTrue | ||
|
||
|
||
class QualifiedIdTest { | ||
@Test | ||
fun givenIdsWithoutDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue() { | ||
// Given | ||
val qualifiedId1 = QualifiedID("id1", "") | ||
val qualifiedId2 = QualifiedID("id1", "") | ||
|
||
// When | ||
val result = qualifiedId1.equalsIgnoringBlankDomain(qualifiedId2) | ||
|
||
// Then | ||
assertTrue(result) | ||
} | ||
|
||
@Test | ||
fun givenOneIdWithoutDomain_whenEqualsIgnoringBlankDomain_thenReturnsTrue() { | ||
// Given | ||
val qualifiedId1 = QualifiedID("id1", "") | ||
val qualifiedId2 = QualifiedID("id1", "domain") | ||
|
||
// When | ||
val result = qualifiedId1.equalsIgnoringBlankDomain(qualifiedId2) | ||
|
||
// Then | ||
assertTrue(result) | ||
} | ||
|
||
@Test | ||
fun givenIdsWithSameDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue() { | ||
// Given | ||
val qualifiedId1 = QualifiedID("id1", "domain") | ||
val qualifiedId2 = QualifiedID("id1", "domain") | ||
|
||
// When | ||
val result = qualifiedId1.equalsIgnoringBlankDomain(qualifiedId2) | ||
|
||
// Then | ||
assertTrue(result) | ||
} | ||
|
||
@Test | ||
fun givenIdsWithDifferentDomains_whenEqualsIgnoringBlankDomain_thenReturnsFalse() { | ||
// Given | ||
val qualifiedId1 = QualifiedID("id1", "domain1") | ||
val qualifiedId2 = QualifiedID("id1", "domain2") | ||
|
||
// When | ||
val result = qualifiedId1.equalsIgnoringBlankDomain(qualifiedId2) | ||
|
||
// Then | ||
assertTrue(!result) | ||
} | ||
|
||
@Test | ||
fun givenIdsWithDifferentValues_whenEqualsIgnoringBlankDomain_thenReturnsFalse() { | ||
// Given | ||
val qualifiedId1 = QualifiedID("id1", "") | ||
val qualifiedId2 = QualifiedID("id2", "") | ||
|
||
// When | ||
val result = qualifiedId1.equalsIgnoringBlankDomain(qualifiedId2) | ||
|
||
// Then | ||
assertFalse(result) | ||
} | ||
} |