Format code.
This commit is contained in:
parent
41c1ed5a3f
commit
a9115ad31b
1 changed files with 27 additions and 26 deletions
|
|
@ -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")!!,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue