mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Format code.
This commit is contained in:
+27
-26
@@ -33,33 +33,36 @@ class DefaultMessageSummaryFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "en")
|
@Config(qualifiers = "en")
|
||||||
fun `format call notification started`() {
|
fun `format call notification started`() {
|
||||||
val expected = formatter.format(TimelineItemRtcNotificationContent(
|
val expected = formatter.format(
|
||||||
callIntent = CallIntent.VIDEO,
|
TimelineItemRtcNotificationContent(
|
||||||
state = RtcNotificationState.Started
|
callIntent = CallIntent.VIDEO,
|
||||||
))
|
state = RtcNotificationState.Started
|
||||||
|
)
|
||||||
|
)
|
||||||
assertThat(expected).isEqualTo("Call started")
|
assertThat(expected).isEqualTo("Call started")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "en")
|
@Config(qualifiers = "en")
|
||||||
fun `format call notification declined by me`() {
|
fun `format call notification declined by me`() {
|
||||||
val expected = formatter.format(TimelineItemRtcNotificationContent(
|
val expected = formatter.format(
|
||||||
callIntent = CallIntent.VIDEO,
|
TimelineItemRtcNotificationContent(
|
||||||
state = RtcNotificationState.Declined(byMe = true)
|
callIntent = CallIntent.VIDEO,
|
||||||
))
|
state = RtcNotificationState.Declined(byMe = true)
|
||||||
|
)
|
||||||
|
)
|
||||||
assertThat(expected).isEqualTo("You declined a call")
|
assertThat(expected).isEqualTo("You declined a call")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "en")
|
@Config(qualifiers = "en")
|
||||||
fun `format call notification declined`() {
|
fun `format call notification declined`() {
|
||||||
val expected = formatter.format(TimelineItemRtcNotificationContent(
|
val expected = formatter.format(
|
||||||
callIntent = CallIntent.VIDEO,
|
TimelineItemRtcNotificationContent(
|
||||||
state = RtcNotificationState.Declined(byMe = false)
|
callIntent = CallIntent.VIDEO,
|
||||||
))
|
state = RtcNotificationState.Declined(byMe = false)
|
||||||
|
)
|
||||||
|
)
|
||||||
assertThat(expected).isEqualTo("Call declined")
|
assertThat(expected).isEqualTo("Call declined")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +72,6 @@ class DefaultMessageSummaryFormatterTest {
|
|||||||
val expected = formatter.format(
|
val expected = formatter.format(
|
||||||
aLocationContent(isLive = true)
|
aLocationContent(isLive = true)
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(expected).isEqualTo("Shared live location")
|
assertThat(expected).isEqualTo("Shared live location")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,27 +81,26 @@ class DefaultMessageSummaryFormatterTest {
|
|||||||
val expected = formatter.format(
|
val expected = formatter.format(
|
||||||
aLocationContent(isLive = false)
|
aLocationContent(isLive = false)
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(expected).isEqualTo("Shared location")
|
assertThat(expected).isEqualTo("Shared location")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun aLocationContent(isLive: Boolean): TimelineItemLocationContent = TimelineItemLocationContent(
|
private fun aLocationContent(isLive: Boolean) = TimelineItemLocationContent(
|
||||||
senderId = A_USER_ID,
|
senderId = A_USER_ID,
|
||||||
senderProfile = aProfileDetails(),
|
senderProfile = aProfileDetails(),
|
||||||
description = null,
|
description = null,
|
||||||
assetType = null,
|
assetType = null,
|
||||||
mode = if (isLive) {
|
mode = if (isLive) {
|
||||||
Mode.Live(
|
Mode.Live(
|
||||||
lastKnownLocation = Location.fromGeoUri("geo:1,5"),
|
lastKnownLocation = Location.fromGeoUri("geo:1,5"),
|
||||||
isActive = true,
|
isActive = true,
|
||||||
endsAt = "",
|
endsAt = "",
|
||||||
endTimestamp = 0,
|
endTimestamp = 0,
|
||||||
isOwnUser = true
|
isOwnUser = true,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Mode.Static(
|
Mode.Static(
|
||||||
location = Location.fromGeoUri("geo:1,5")!!
|
location = Location.fromGeoUri("geo:1,5")!!,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user