fix: anon user error (#3772)

* fix: anon user error

* ci: fix tests
This commit is contained in:
Nathan.fooo
2023-10-24 23:13:51 +08:00
committed by GitHub
parent 71f80be8f7
commit cceee80799
39 changed files with 227 additions and 230 deletions

View File

@ -1,6 +1,7 @@
use uuid::Uuid;
use flowy_encrypt::{encrypt_text, generate_encryption_secret};
use flowy_error::FlowyError;
use flowy_user_deps::entities::*;
use lib_infra::box_any::BoxAny;
@ -66,7 +67,6 @@ async fn supabase_update_user_profile_test() {
let user_profile = user_service
.get_user_profile(UserCredentials::from_uid(user.user_id))
.await
.unwrap()
.unwrap();
assert_eq!(user_profile.name, "123");
@ -89,7 +89,6 @@ async fn supabase_get_user_profile_test() {
user_service
.get_user_profile(credential.clone())
.await
.unwrap()
.unwrap();
}
@ -100,12 +99,12 @@ async fn supabase_get_not_exist_user_profile_test() {
}
let user_service = user_auth_service();
let result = user_service
let result: FlowyError = user_service
.get_user_profile(UserCredentials::from_uid(i64::MAX))
.await
.unwrap();
.unwrap_err();
// user not found
assert!(result.is_none());
assert!(result.is_record_not_found());
}
#[tokio::test]
@ -134,7 +133,6 @@ async fn user_encryption_sign_test() {
let user_profile: UserProfile = user_service
.get_user_profile(UserCredentials::from_uid(user.user_id))
.await
.unwrap()
.unwrap();
assert_eq!(
user_profile.encryption_type,