Don't offer to delete a list that is the account's calendar home (#180)
This commit is contained in:
1 parent
74d6be61f2
commit
1c59c5e409
13 files changed
+65
-11
No files matched your search
@@ -39,4 +39,27 @@ class RoomTaskMapperTest {
|
||||
assertThat(RoomTaskMapper.taskList(list).accountName).isEqualTo("Work server")
|
||||
assertThat(RoomTaskMapper.taskList(list.copy(accountLabel = null)).accountName).isEqualTo("me@host")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a list at the account's home set is the account's home (#180)`() {
|
||||
val list = TaskListRow(
|
||||
list = TaskListEntity(
|
||||
id = 2,
|
||||
name = "Kalender",
|
||||
color = 0,
|
||||
accountId = 1,
|
||||
href = "https://webmail.example.com/calendars/user/1",
|
||||
),
|
||||
accountDisplayName = "user",
|
||||
accountHomeSetUrl = "https://webmail.example.com/calendars/user/1/",
|
||||
)
|
||||
|
||||
assertThat(RoomTaskMapper.taskList(list).isAccountHome).isTrue()
|
||||
assertThat(
|
||||
RoomTaskMapper.taskList(
|
||||
list.copy(list = list.list.copy(href = "https://webmail.example.com/calendars/user/1/tasks/")),
|
||||
).isAccountHome,
|
||||
).isFalse()
|
||||
assertThat(RoomTaskMapper.taskList(list.copy(accountHomeSetUrl = null)).isAccountHome).isFalse()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user