test(tui): cover username directories setting and regenerate openrpc doc
This commit is contained in:
@@ -240,6 +240,9 @@
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"use_username_dirs": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
@@ -250,6 +253,7 @@
|
||||
"token",
|
||||
"size",
|
||||
"download_directory",
|
||||
"use_username_dirs",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
|
||||
@@ -509,6 +509,7 @@ mod tests {
|
||||
s.rows(),
|
||||
vec![
|
||||
SettingsRow::ChangePassword,
|
||||
SettingsRow::UseUsernameDirs,
|
||||
SettingsRow::DownloadDir,
|
||||
SettingsRow::Share(0),
|
||||
]
|
||||
@@ -516,6 +517,8 @@ mod tests {
|
||||
// The row below "change password" is the download folder, not a
|
||||
// logout the window cannot perform.
|
||||
s.handle_key(key(KeyCode::Down));
|
||||
assert_eq!(s.selected_row(), SettingsRow::UseUsernameDirs);
|
||||
s.handle_key(key(KeyCode::Down));
|
||||
assert_eq!(s.selected_row(), SettingsRow::DownloadDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +192,7 @@ fn an_attached_window_offers_no_logout() {
|
||||
let mut tui = attach(session);
|
||||
press(&mut tui, KeyCode::Char('o'));
|
||||
press(&mut tui, KeyCode::Down);
|
||||
press(&mut tui, KeyCode::Down);
|
||||
press(&mut tui, KeyCode::Enter);
|
||||
|
||||
let settings = tui.state.settings.as_ref().expect("still open");
|
||||
|
||||
@@ -17,6 +17,7 @@ fn download_entry(filename: &str, status: DownloadStatus) -> DownloadEntry {
|
||||
token: 1,
|
||||
size: 1000,
|
||||
download_directory: "/music".into(),
|
||||
use_username_dirs: false,
|
||||
status,
|
||||
sender: std::sync::mpsc::channel().0,
|
||||
queue_position: None,
|
||||
|
||||
@@ -56,6 +56,7 @@ impl Window {
|
||||
let tui = MainTui::new(
|
||||
client,
|
||||
downloads.display().to_string(),
|
||||
false,
|
||||
SEARCH_WINDOW,
|
||||
Some(StateStore::new(state.to_path_buf())),
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user