Skip to content

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

fix: correct web chat config test to validate default values

Steven Enamakele5f282745a3f
diff --git a/crates/openhuman-core/src/config/schema/web_chat_config_tests.rs b/crates/openhuman-core/src/config/schema/web_chat_config_tests.rs
new file mode 100644
index 0000000000..30d6a0455a
--- /dev/null
+++ b/crates/openhuman-core/src/config/schema/web_chat_config_tests.rs
@@ -0,0 +1,20 @@
+use super::WebChatConfig;
+
+#[test]
+fn defaults_to_suggestions_enabled() {
+ let config = WebChatConfig::default();
+ assert!(config.suggestions_enabled);
+}
+
+#[test]
+fn deserializes_missing_field_as_enabled() {
+ let config: WebChatConfig = serde_json::from_str("{}").unwrap();
+ assert!(config.suggestions_enabled);
+}
+
+#[test]
+fn deserializes_explicit_false() {
+ let config: WebChatConfig =
+ serde_json::from_str(r#"{"suggestions_enabled": false}"#).unwrap();
+ assert!(!config.suggestions_enabled);
+}