mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +03:00
Unit tests: adding verification that redaction does not happen when event id is empty
This commit is contained in:
parent
2121ec5739
commit
7961525869
2 changed files with 9 additions and 2 deletions
|
@ -45,5 +45,7 @@ class RedactLiveLocationShareEventUseCaseTest {
|
|||
val event = Event(eventId = "")
|
||||
|
||||
redactLiveLocationShareEventUseCase.execute(event = event, room = fakeRoom, reason = A_REASON)
|
||||
|
||||
fakeRoom.locationSharingService().verifyRedactLiveLocationShare(inverse = true, beaconInfoEventId = "", reason = A_REASON)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,12 @@ class FakeLocationSharingService : LocationSharingService by mockk() {
|
|||
coEvery { redactLiveLocationShare(beaconInfoEventId, reason) } just runs
|
||||
}
|
||||
|
||||
fun verifyRedactLiveLocationShare(beaconInfoEventId: String, reason: String?) {
|
||||
coVerify { redactLiveLocationShare(beaconInfoEventId, reason) }
|
||||
/**
|
||||
* @param inverse when true it will check redaction of the live did not happen
|
||||
* @param beaconInfoEventId event id of the beacon related to the live
|
||||
* @param reason reason explaining the redaction
|
||||
*/
|
||||
fun verifyRedactLiveLocationShare(inverse: Boolean = false, beaconInfoEventId: String, reason: String?) {
|
||||
coVerify(inverse = inverse) { redactLiveLocationShare(beaconInfoEventId, reason) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue