fix: resolve test failures and clippy warnings

- tests/App.test.tsx: remove outdated SettingsPage mock, use dynamic import
- database/tests.rs: remove unused field, use struct init syntax
- deeplink/tests.rs: use idiomatic assert!() instead of assert_eq!(true)
- support.rs: add #[allow(dead_code)] for test utilities
- usage_stats.rs: code formatting
This commit is contained in:
Jason
2025-12-30 08:54:48 +08:00
parent bcfc22514c
commit 83a5597756
5 changed files with 17 additions and 36 deletions

View File

@@ -49,6 +49,7 @@ pub fn test_mutex() -> &'static Mutex<()> {
}
/// 创建测试用的 AppState包含一个空的数据库
#[allow(dead_code)]
pub fn create_test_state() -> Result<AppState, Box<dyn std::error::Error>> {
let db = Arc::new(Database::init()?);
let proxy_service = ProxyService::new(db.clone());
@@ -56,6 +57,7 @@ pub fn create_test_state() -> Result<AppState, Box<dyn std::error::Error>> {
}
/// 创建测试用的 AppState并从 MultiAppConfig 迁移数据
#[allow(dead_code)]
pub fn create_test_state_with_config(
config: &MultiAppConfig,
) -> Result<AppState, Box<dyn std::error::Error>> {