mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 07:16:31 +03:00
really test MX lookup in test_oauth_from_mx() (#2854)
This commit is contained in:
@@ -378,13 +378,17 @@ mod tests {
|
|||||||
|
|
||||||
#[async_std::test]
|
#[async_std::test]
|
||||||
async fn test_oauth_from_mx() {
|
async fn test_oauth_from_mx() {
|
||||||
// TODO: this does not test MX lookup, google.com is in our provider-db
|
// youtube staff seems to use "google workspace with oauth2", figures this out by MX lookup
|
||||||
// does anyone know a "good" Google Workspace (former G Suite) domain we can use for testing?
|
|
||||||
let t = TestContext::new().await;
|
let t = TestContext::new().await;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Oauth2::from_address(&t, "hello@google.com", false).await,
|
Oauth2::from_address(&t, "hello@youtube.com", false).await,
|
||||||
Some(OAUTH2_GMAIL)
|
Some(OAUTH2_GMAIL)
|
||||||
);
|
);
|
||||||
|
// without MX lookup, we would not know as youtube.com is not in our provider-db
|
||||||
|
assert_eq!(
|
||||||
|
Oauth2::from_address(&t, "hello@youtube.com", true).await,
|
||||||
|
None
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_std::test]
|
#[async_std::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user