Validate channel file IDs and exercise downloads from the Slint browser
This commit is contained in:
1 parent
8d4daf4ef8
commit
a3ee6cc0c0
6 files changed
+42
-4
No files matched your search
@@ -290,6 +290,20 @@ fn client_menu_commands_are_validated_and_never_fake_success_offline() {
|
||||
core.shutdown();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn file_browser_rejects_invalid_list_before_connection() {
|
||||
let dir = TempDir::new("file-list-boundary");
|
||||
let mut core = Core::start(&dir.0);
|
||||
for args in [json!({"channel_id":0,"path":"/"}), json!({"channel_id":9_007_199_254_740_992u64,"path":"/"}),
|
||||
json!({"channel_id":1,"path":"/a/../b"}), json!({"channel_id":1,"path":"/","unexpected":true})] {
|
||||
let (reply, _) = core.request("invalid-list", "file_list", args);
|
||||
assert_eq!(reply["error"]["code"], "bad_request", "{reply}");
|
||||
}
|
||||
let (reply, _) = core.request("valid-list", "file_list", json!({"channel_id":9_007_199_254_740_991u64,"path":"/"}));
|
||||
assert_eq!(reply["error"]["code"], "not_connected", "{reply}");
|
||||
core.shutdown();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn publisher_commands_validate_through_real_stdio_without_server() {
|
||||
let dir = TempDir::new("publisher");
|
||||
|
||||
Reference in new issue
Block a user