File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1163,6 +1163,7 @@ pub fn log_dir(cfg: &Config) -> std::io::Result<PathBuf> {
1163
1163
#[ cfg( test) ]
1164
1164
mod tests {
1165
1165
use crate :: config_types:: HistoryPersistence ;
1166
+ use crate :: config_types:: Notifications ;
1166
1167
1167
1168
use super :: * ;
1168
1169
use pretty_assertions:: assert_eq;
@@ -1201,6 +1202,19 @@ persistence = "none"
1201
1202
) ;
1202
1203
}
1203
1204
1205
+ #[ test]
1206
+ fn tui_config_missing_notifications_field_defaults_to_disabled ( ) {
1207
+ let cfg = r#"
1208
+ [tui]
1209
+ "# ;
1210
+
1211
+ let parsed = toml:: from_str :: < ConfigToml > ( cfg)
1212
+ . expect ( "TUI config without notifications should succeed" ) ;
1213
+ let tui = parsed. tui . expect ( "config should include tui section" ) ;
1214
+
1215
+ assert_eq ! ( tui. notifications, Notifications :: Enabled ( false ) ) ;
1216
+ }
1217
+
1204
1218
#[ test]
1205
1219
fn test_sandbox_config_parsing ( ) {
1206
1220
let sandbox_full_access = r#"
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ impl Default for Notifications {
94
94
pub struct Tui {
95
95
/// Enable desktop notifications from the TUI when the terminal is unfocused.
96
96
/// Defaults to `false`.
97
+ #[ serde( default ) ]
97
98
pub notifications : Notifications ,
98
99
}
99
100
You can’t perform that action at this time.
0 commit comments