Add test for the scheme io.element.call
This commit is contained in:
parent
1244761be2
commit
1d0af23d52
1 changed files with 22 additions and 0 deletions
|
|
@ -83,6 +83,14 @@ class CallIntentDataParserTests {
|
|||
assertThat(callIntentDataParser.parse(url)).isEqualTo(embeddedUrl)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `element scheme 2 with url param gets url extracted`() {
|
||||
val embeddedUrl = "http://call.element.io/some-actual-call?with=parameters"
|
||||
val encodedUrl = URLEncoder.encode(embeddedUrl, "utf-8")
|
||||
val url = "io.element.call:/?url=$encodedUrl"
|
||||
assertThat(callIntentDataParser.parse(url)).isEqualTo(embeddedUrl)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `element scheme with call host and no url param returns null`() {
|
||||
val embeddedUrl = "http://call.element.io/some-actual-call?with=parameters"
|
||||
|
|
@ -91,6 +99,14 @@ class CallIntentDataParserTests {
|
|||
assertThat(callIntentDataParser.parse(url)).isNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `element scheme 2 with no url returns null`() {
|
||||
val embeddedUrl = "http://call.element.io/some-actual-call?with=parameters"
|
||||
val encodedUrl = URLEncoder.encode(embeddedUrl, "utf-8")
|
||||
val url = "io.element.call:/?no_url=$encodedUrl"
|
||||
assertThat(callIntentDataParser.parse(url)).isNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `element scheme with no call host returns null`() {
|
||||
val embeddedUrl = "http://call.element.io/some-actual-call?with=parameters"
|
||||
|
|
@ -104,4 +120,10 @@ class CallIntentDataParserTests {
|
|||
val url = "element://call?url="
|
||||
assertThat(callIntentDataParser.parse(url)).isNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `element scheme 2 with no data returns null`() {
|
||||
val url = "io.element.call:/?url="
|
||||
assertThat(callIntentDataParser.parse(url)).isNull()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue