Add some previews.

This commit is contained in:
Benoit Marty 2023-02-14 13:39:00 +01:00 committed by Benoit Marty
parent 24984416dd
commit 442fb212ae
2 changed files with 37 additions and 2 deletions

View file

@ -25,8 +25,7 @@ open class MatrixUserProvider : PreviewParameterProvider<MatrixUser> {
override val values: Sequence<MatrixUser>
get() = sequenceOf(
aMatrixUser(),
MatrixUser(
id = UserId("@id_of_alice:server.org"),
aMatrixUser().copy(
username = null,
avatarData = anAvatarData().copy(name = null)
),
@ -38,3 +37,15 @@ fun aMatrixUser() = MatrixUser(
username = "Alice",
avatarData = anAvatarData()
)
open class MatrixUserWithNullProvider : PreviewParameterProvider<MatrixUser?> {
override val values: Sequence<MatrixUser?>
get() = sequenceOf(
aMatrixUser(),
aMatrixUser().copy(
username = null,
avatarData = anAvatarData().copy(name = null)
),
null,
)
}