diff --git a/Cargo.lock b/Cargo.lock index 55420011..4280d02b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1861,6 +1861,7 @@ dependencies = [ "serde", "serde_json", "store", + "tokio", "tracing", "utils", ] diff --git a/crates/jmap-proto/Cargo.toml b/crates/jmap-proto/Cargo.toml index 127601ce..598068a9 100644 --- a/crates/jmap-proto/Cargo.toml +++ b/crates/jmap-proto/Cargo.toml @@ -13,3 +13,6 @@ serde = { version = "1.0", features = ["derive"]} ahash = { version = "0.8.0", features = ["serde"] } serde_json = { version = "1.0", features = ["raw_value"] } tracing = "0.1" + +[dev-dependencies] +tokio = { version = "1.23", features = ["full"] } diff --git a/crates/jmap-proto/src/request/parser.rs b/crates/jmap-proto/src/request/parser.rs index 52249796..6cb6c669 100644 --- a/crates/jmap-proto/src/request/parser.rs +++ b/crates/jmap-proto/src/request/parser.rs @@ -252,8 +252,101 @@ mod tests { } "#; + const TEST2: &str = r##" + { + "using": [ + "urn:ietf:params:jmap:submission", + "urn:ietf:params:jmap:mail", + "urn:ietf:params:jmap:core" + ], + "methodCalls": [ + [ + "Email/set", + { + "accountId": "c", + "create": { + "c37ee58b-e224-4799-88e6-1d7484e3b782": { + "mailboxIds": { + "9": true + }, + "subject": "test", + "from": [ + { + "name": "Foo", + "email": "foo@bar.com" + } + ], + "to": [ + { + "name": null, + "email": "bar@foo.com" + } + ], + "cc": [], + "bcc": [], + "replyTo": [ + { + "name": null, + "email": "foo@bar.com" + } + ], + "htmlBody": [ + { + "partId": "c37ee58b-e224-4799-88e6-1d7484e3b782", + "type": "text/html" + } + ], + "bodyValues": { + "c37ee58b-e224-4799-88e6-1d7484e3b782": { + "value": "
test email