Add error handling tests for dcaccount parameters

Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-15 22:29:31 +00:00
parent 1fb387c17d
commit 18723d19a5
+38
View File
@@ -840,6 +840,44 @@ async fn test_decode_account_with_custom_username() -> Result<()> {
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_decode_account_with_params_missing_password() -> Result<()> {
// Test that missing password returns an error
let ctx = TestContext::new().await;
let result = check_qr(
&ctx.ctx,
"dcaccount:example.org?v=1&ih=imap.example.org",
)
.await;
assert!(result.is_err());
assert!(result
.unwrap_err()
.to_string()
.contains("password missing"));
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_decode_account_with_params_missing_version() -> Result<()> {
// Test that missing version returns an error
let ctx = TestContext::new().await;
let result = check_qr(
&ctx.ctx,
"dcaccount:example.org?p=secret&ih=imap.example.org",
)
.await;
assert!(result.is_err());
assert!(result
.unwrap_err()
.to_string()
.contains("version missing"));
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_decode_tg_socks_proxy() -> Result<()> {
let t = TestContext::new().await;