Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(tui): cover voice note transcript and duration label

Steven Enamakel77a17f24bee9
diff --git a/crates/openhuman-tui/src/state_tests.rs b/crates/openhuman-tui/src/state_tests.rs
index 32c5e77a52..408c3e51ce 100644
--- a/crates/openhuman-tui/src/state_tests.rs
+++ b/crates/openhuman-tui/src/state_tests.rs
@@ -261,6 +261,24 @@ fn projected_transcript_is_restored_in_chronological_order() {
assert_eq!(state.entries()[1].text, "answer");
}
+#[test]
+fn projected_voice_note_keeps_its_transcript_and_duration_label() {
+ let mut state = TranscriptState::new(CLIENT);
+ state.load_transcript(&serde_json::json!({
+ "result": {"data": {"items": [
+ {
+ "kind": "userMessage",
+ "content": "Remind me about the dentist",
+ "extraMetadata": {"voiceNote": {"durationMs": 12000}}
+ }
+ ]}}
+ }));
+ assert_eq!(
+ state.entries()[0].text,
+ "[voice note 0:12] Remind me about the dentist"
+ );
+}
+
#[test]
fn tool_result_updates_the_originating_activity() {
let mut s = TranscriptState::new(CLIENT);