Change a room's permissions power levels (#2525)
* Change a room's permissions power levels * Make `currentPermissions` use a `MatrixRoomPowerLevels?` instance instead. * Update strings * Update screenshots --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
3453738344
commit
59a682b407
71 changed files with 1556 additions and 58 deletions
|
|
@ -29,12 +29,31 @@ class EnsureCalledOnce : () -> Unit {
|
|||
}
|
||||
}
|
||||
|
||||
class EnsureCalledTimes(val times: Int) : () -> Unit {
|
||||
private var counter = 0
|
||||
override fun invoke() {
|
||||
counter++
|
||||
}
|
||||
|
||||
fun assertSuccess() {
|
||||
if (counter != times) {
|
||||
throw AssertionError("Expected to be called $times, but was called $counter times")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun ensureCalledOnce(block: (callback: () -> Unit) -> Unit) {
|
||||
val callback = EnsureCalledOnce()
|
||||
block(callback)
|
||||
callback.assertSuccess()
|
||||
}
|
||||
|
||||
fun ensureCalledTimes(times: Int, block: (callback: () -> Unit) -> Unit) {
|
||||
val callback = EnsureCalledTimes(times)
|
||||
block(callback)
|
||||
callback.assertSuccess()
|
||||
}
|
||||
|
||||
class EnsureCalledOnceWithParam<T, R>(
|
||||
private val expectedParam: T,
|
||||
private val result: R,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import androidx.compose.ui.test.hasContentDescription
|
|||
import androidx.compose.ui.test.hasTestTag
|
||||
import androidx.compose.ui.test.hasText
|
||||
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
|
||||
import androidx.compose.ui.test.onFirst
|
||||
import androidx.compose.ui.test.performClick
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
import org.junit.rules.TestRule
|
||||
|
|
@ -34,6 +35,16 @@ fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.clickOn(@StringR
|
|||
.performClick()
|
||||
}
|
||||
|
||||
fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.clickOnFirst(@StringRes res: Int) {
|
||||
val text = activity.getString(res)
|
||||
onAllNodes(hasText(text) and hasClickAction()).onFirst().performClick()
|
||||
}
|
||||
|
||||
fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.clickOnLast(@StringRes res: Int) {
|
||||
val text = activity.getString(res)
|
||||
onAllNodes(hasText(text) and hasClickAction()).onFirst().performClick()
|
||||
}
|
||||
|
||||
/**
|
||||
* Press the back button in the app bar.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cce394023e7c5bac40bcf234f9073196b1eb424893760f29d609eb329f62817f
|
||||
size 42587
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:97eaf8930ebc7c127dddb12a1002161aa10b120f87ce88779ea96ff35790e344
|
||||
size 38372
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2d6818023d37493825ba7b929470152847c397b5f19a5bd8ee862fc900dee690
|
||||
size 40755
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:86aa47d55841e5041bf56534852dd716b4546cc3657a30133b88c0c87998f16c
|
||||
size 42464
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:237125629b6449d6898391235b625248b71629b4d96415b80fb7ef5e773e86b2
|
||||
size 40484
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:753eecb930bf0659671f2f1ecb2a64ae226aac96c5365ed549c635fd90c8c729
|
||||
size 40951
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d0b37566f62e30fcb4f16364a9ac2c008a98a5429c3fa5724d7ef6455e79cf34
|
||||
size 47995
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dff4c4a80156b2977da007d6258d1cd6cefc93bc709ec33bff0e1b484604cf0a
|
||||
size 38506
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:635c8d6bdaafb07706d95d5a9cb9a4e828ef312c31b33a80f6deff1a1c3b206f
|
||||
size 34554
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:af5a843cc9cd5a51d986ba7dae7d2c6a088f862f46bac961667a1fb1d62b8a20
|
||||
size 36966
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:059e598dc973e8c01dba4ef49accf47ea2bd74377dfbfb441c3c213fc77a1cee
|
||||
size 38158
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c34415877b279b2018d02667cc98b4857f4ae5bfa68d169f3226a0c99ed4620b
|
||||
size 36699
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dc02c16667b78ca5a9985da6816f17bbd0f7bb2307569aacaf3391ccd8431bd5
|
||||
size 36567
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4faece23a4780f5465abe42587f56933ecded55bf3ae966a9e6b634e7df1e049
|
||||
size 42845
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ee5c36535582ecb91b7315afa70bae38db2c7287760071293dbf5fac2b8000b4
|
||||
size 43609
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4c5d2d8a8e672c19e1ed9cd37291a6355f815fcd55157fca7a5966bba0baa830
|
||||
size 43303
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3c63e9045666c863d13865f4d40563a57ee7ec2110de023455a16d400eb67d26
|
||||
size 41977
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:905960605341e3cf5987025bdc560e0141f1b5f1ff5e5b114d3f698712e3428d
|
||||
size 39869
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7cd6b2f0b51fe273ee5479e77a4762d4addb8e59560edbbb4a3ce4520ceb4a75
|
||||
size 51493
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3c63e9045666c863d13865f4d40563a57ee7ec2110de023455a16d400eb67d26
|
||||
size 41977
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c25b6b3d2699895a4b34a61864d2b57aad9f44d5488830f5f2e061fddf42e32
|
||||
size 40355
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:09a844501c3aea35d5ec151415b25c5be8960b98697a99dba450c8a25fb69c8b
|
||||
size 39847
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5d262c2c0681ea12ce6920af395bd56aa58a97448ade03997cd22e921d1e2f77
|
||||
size 39564
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a1e7414cc8c9412c45e55ea77842b908a1979aa680a66609cbdfa6f5a91d87c9
|
||||
size 37925
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a08860391a1f9854c2354ede0236e0ea78bd1242b134121e2e6a1903e7b8a6b2
|
||||
size 35378
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:865c6148937271e08a14f4820652b9c9109b81eca71b715711460c8fe14fcc97
|
||||
size 45654
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a1e7414cc8c9412c45e55ea77842b908a1979aa680a66609cbdfa6f5a91d87c9
|
||||
size 37925
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9b9d5ca3bccf0fbca3ced8392f2ca42dd448c032d97d81291357dc3a1bb33ea2
|
||||
size 35806
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5c6410198fc2f7e74279e21013718bf8326bfd871fa7ffa244470725f7bf3ae5
|
||||
size 23045
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3d6fce3b7fa9ac12e25f135ddeabb96dad4bba9422926e5451647255a712e481
|
||||
size 22772
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c788eab0495478d8253cbd11970c57c83670e2b761a675b413642db3c6ee57fa
|
||||
size 25095
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:98f81fcfa9cb5c7c02f8322ca4e444df32e81acb5f0d79f39841f9b71c436594
|
||||
size 26376
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dbc67150e8d533fd473204fbf4c9360751b8498831c435a06e9ed1525dfa1d7b
|
||||
size 21637
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:09b42b37d3e05cfe60187512403139b305c39d4d3ff59d122d73762a548d01fa
|
||||
size 21364
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:50b1f5c23b436ca2f6045c4d2a6d14c7902a5f10646ce59522a02c2edc297374
|
||||
size 22310
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1b7f91366d3576553c7dd2bc469290fa094dc4095510bb5e841fa0a9b179e85d
|
||||
size 23085
|
||||
Loading…
Add table
Add a link
Reference in a new issue