mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Fix test and add new tests.
This commit is contained in:
committed by
Benoit Marty
parent
67608cd16e
commit
050dbdfa7c
@@ -209,13 +209,33 @@ class IntentResolverTest {
|
|||||||
permalinkParserResult = { permalinkData }
|
permalinkParserResult = { permalinkData }
|
||||||
)
|
)
|
||||||
val intent = Intent(RuntimeEnvironment.getApplication(), Activity::class.java).apply {
|
val intent = Intent(RuntimeEnvironment.getApplication(), Activity::class.java).apply {
|
||||||
action = Intent.ACTION_SEND
|
action = Intent.ACTION_BATTERY_LOW
|
||||||
data = "https://matrix.to/invalid".toUri()
|
data = "https://matrix.to/invalid".toUri()
|
||||||
}
|
}
|
||||||
val result = sut.resolve(intent)
|
val result = sut.resolve(intent)
|
||||||
assertThat(result).isNull()
|
assertThat(result).isNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test incoming share simple`() {
|
||||||
|
val sut = createIntentResolver()
|
||||||
|
val intent = Intent(RuntimeEnvironment.getApplication(), Activity::class.java).apply {
|
||||||
|
action = Intent.ACTION_SEND
|
||||||
|
}
|
||||||
|
val result = sut.resolve(intent)
|
||||||
|
assertThat(result).isEqualTo(ResolvedIntent.IncomingShare(intent = intent))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test incoming share multiple`() {
|
||||||
|
val sut = createIntentResolver()
|
||||||
|
val intent = Intent(RuntimeEnvironment.getApplication(), Activity::class.java).apply {
|
||||||
|
action = Intent.ACTION_SEND_MULTIPLE
|
||||||
|
}
|
||||||
|
val result = sut.resolve(intent)
|
||||||
|
assertThat(result).isEqualTo(ResolvedIntent.IncomingShare(intent = intent))
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test resolve invalid`() {
|
fun `test resolve invalid`() {
|
||||||
val sut = createIntentResolver(
|
val sut = createIntentResolver(
|
||||||
|
|||||||
Reference in New Issue
Block a user