()
| 640 | |
| 641 | #[test] |
| 642 | fn test_get_node_field() { |
| 643 | let node = KgNode::new("x", "intent", "PIMO-1", "vault") |
| 644 | .with_summary("Fix auth") |
| 645 | .with_metadata(serde_json::json!({"status": "in-progress", "priority": "high"})); |
| 646 | |
| 647 | assert_eq!(get_node_field(&node, "kind"), Some("intent".to_string())); |
| 648 | assert_eq!(get_node_field(&node, "label"), Some("PIMO-1".to_string())); |
| 649 | assert_eq!( |
| 650 | get_node_field(&node, "summary"), |
| 651 | Some("Fix auth".to_string()) |
| 652 | ); |
| 653 | assert_eq!(get_node_field(&node, "id"), Some("x".to_string())); |
| 654 | assert_eq!(get_node_field(&node, "source"), Some("vault".to_string())); |
| 655 | assert_eq!( |
| 656 | get_node_field(&node, "status"), |
| 657 | Some("in-progress".to_string()) |
| 658 | ); |
| 659 | assert_eq!(get_node_field(&node, "priority"), Some("high".to_string())); |
| 660 | assert_eq!(get_node_field(&node, "nonexistent"), None); |
| 661 | } |
| 662 | |
| 663 | #[test] |
| 664 | fn test_get_node_field_metadata_types() { |
nothing calls this directly
no test coverage detected