JMAP tests reorganization

This commit is contained in:
mdecimus
2025-10-11 17:11:26 +02:00
parent 5a65f091fc
commit 5df5790210
84 changed files with 560 additions and 515 deletions

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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::{

View File

@@ -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;