feat: kanban: coments
runner nix smoke / nix label and flake smoke (push) Failing after 1m17s

This commit is contained in:
2026-09-29 19:48:14 +00:00
parent c93dee27b3
commit e22dcdda80
6 changed files with 253 additions and 3 deletions
+38
View File
@@ -9,6 +9,24 @@ pub struct Issue {
pub body: Option<String>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
pub struct Comment {
pub id: u64,
pub body: String,
#[serde(default)]
pub user: Option<CommentUser>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
pub struct CommentUser {
pub login: String,
}
#[derive(Debug, Serialize, PartialEq, Eq)]
pub struct CommentPayload {
pub body: String,
}
#[derive(Debug, Serialize, PartialEq, Eq)]
pub struct CreateIssuePayload {
pub title: String,
@@ -117,4 +135,24 @@ mod tests {
serde_json::json!({"title": "Updated", "body": "Changed"})
);
}
#[test]
fn serializes_and_deserializes_comment_data() {
let comment: Comment = serde_json::from_value(serde_json::json!({
"id": 9001,
"body": "Investigating",
"user": {"login": "alice"}
}))
.expect("comment JSON");
let payload = CommentPayload {
body: "Resolved".to_owned(),
};
assert_eq!(comment.id, 9001);
assert_eq!(comment.user.expect("comment user").login, "alice");
assert_eq!(
serde_json::to_value(payload).expect("comment payload"),
serde_json::json!({"body": "Resolved"})
);
}
}