Skip to content

Commit 47a6c32

Browse files
committed
fix(tests): update test fixtures to match current schema
Test compilation failed due to outdated test fixtures after schema changes. Fixed: - models/mod.rs: Project struct now has id: String (was i64), path: Option<String> (was String), removed session_count and last_opened_at fields, added updated_at - error.rs: AppError::NotFound expects String, not &str All tests now compile and pass.
1 parent 322ce1a commit 47a6c32

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src-tauri/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mod tests {
9292

9393
#[test]
9494
fn test_error_to_string() {
95-
let err: String = AppError::NotFound("test").into();
95+
let err: String = AppError::NotFound("test".to_string()).into();
9696
assert_eq!(err, "Not found: test");
9797
}
9898
}

src-tauri/src/models/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ mod tests {
2727
#[test]
2828
fn test_project_serialization() {
2929
let p = Project {
30-
id: 1,
30+
id: "test-id-123".to_string(),
3131
name: "test-project".to_string(),
32-
path: "/home/test/project".to_string(),
33-
session_count: 0,
34-
last_opened_at: "2025-01-01T00:00:00Z".to_string(),
32+
path: Some("/home/test/project".to_string()),
3533
created_at: "2025-01-01T00:00:00Z".to_string(),
34+
updated_at: "2025-01-01T00:00:00Z".to_string(),
3635
};
3736
let json = serde_json::to_string(&p).unwrap();
3837
assert!(json.contains("test-project"));

0 commit comments

Comments
 (0)