JMAP tests reorganization
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use crate::jmap::mailbox::destroy_all_mailboxes_for_account;
|
||||
use crate::jmap::mail::mailbox::destroy_all_mailboxes_for_account;
|
||||
|
||||
use super::WebDavTest;
|
||||
use email::cache::MessageCacheFetch;
|
||||
|
||||
@@ -288,6 +288,19 @@ fn roundtrip_expansion(ics: &str, ignore_errors: bool) {
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
events_archive,
|
||||
event_data
|
||||
.expand_from_ids(
|
||||
&mut events
|
||||
.iter()
|
||||
.map(|e| e.expansion_id)
|
||||
.collect::<AHashSet<_>>(),
|
||||
Tz::UTC
|
||||
)
|
||||
.unwrap()
|
||||
);
|
||||
events.sort_by(|a, b| {
|
||||
if a.comp_id == b.comp_id {
|
||||
a.start.cmp(&b.start)
|
||||
@@ -302,6 +315,9 @@ fn roundtrip_expansion(ics: &str, ignore_errors: bool) {
|
||||
a.comp_id.cmp(&b.comp_id)
|
||||
}
|
||||
});
|
||||
for event in events.iter_mut().chain(events_archive.iter_mut()) {
|
||||
event.expansion_id = 0;
|
||||
}
|
||||
|
||||
assert_eq!(events, events_archive);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
use super::WebDavTest;
|
||||
use crate::{
|
||||
jmap::mailbox::destroy_all_mailboxes_for_account,
|
||||
jmap::mail::mailbox::destroy_all_mailboxes_for_account,
|
||||
webdav::{DummyWebDavClient, prop::ALL_DAV_PROPERTIES},
|
||||
};
|
||||
use calcard::{
|
||||
|
||||
@@ -533,8 +533,8 @@ pub async fn test(test: &WebDavTest, assisted_discovery: bool) {
|
||||
),
|
||||
(DavProperty::WebDav(WebDavProperty::DisplayName), ""),
|
||||
];
|
||||
if !is_file && resource_type == DavResourceName::Cal {
|
||||
// DisplayName can be removed from calendar collections
|
||||
if !is_file {
|
||||
// DisplayName can't be removed from calendar/contact collections
|
||||
props.pop();
|
||||
}
|
||||
client.patch_and_check(path, props).await;
|
||||
|
||||
Reference in New Issue
Block a user