()
| 733 | |
| 734 | #[test] |
| 735 | fn test_get_node_field() { |
| 736 | let node = KgNode::new("x", Class::WorkIntent, "PIMO-1", "vault") |
| 737 | .with_summary("Fix auth") |
| 738 | .with_metadata(serde_json::json!({"status": "in-progress", "priority": "high"})); |
| 739 | |
| 740 | assert_eq!( |
| 741 | get_node_field(&node, "type"), |
| 742 | Some(Class::WorkIntent.iri().to_string()) |
| 743 | ); |
| 744 | assert_eq!(get_node_field(&node, "label"), Some("PIMO-1".to_string())); |
| 745 | assert_eq!( |
| 746 | get_node_field(&node, "summary"), |
| 747 | Some("Fix auth".to_string()) |
| 748 | ); |
| 749 | assert_eq!(get_node_field(&node, "id"), Some("x".to_string())); |
| 750 | assert_eq!(get_node_field(&node, "source"), Some("vault".to_string())); |
| 751 | assert_eq!( |
| 752 | get_node_field(&node, "status"), |
| 753 | Some("in-progress".to_string()) |
| 754 | ); |
| 755 | assert_eq!(get_node_field(&node, "priority"), Some("high".to_string())); |
| 756 | assert_eq!(get_node_field(&node, "nonexistent"), None); |
| 757 | } |
| 758 | |
| 759 | #[test] |
| 760 | fn test_get_node_field_metadata_types() { |
nothing calls this directly
no test coverage detected