Expand description
An Os a test scripts and reads, under the testing feature.
use std::path::PathBuf;
use hypersig_desktop::testing::{DialogKind, FakeOs};
let fake = FakeOs::new();
fake.answer_dialog([PathBuf::from("/notes/today.md")]);
let os = fake.os();
// A handler given `os` asks for a file and gets the one the test chose.
assert_eq!(os.dialog().open_file().await, Some(PathBuf::from("/notes/today.md")));
os.clipboard().write_text("copied").await.unwrap();
assert_eq!(fake.clipboard_text().as_deref(), Some("copied"));
assert_eq!(fake.dialogs()[0].kind, DialogKind::OpenFile);Structs§
- Arranged
- How the handlers arranged a window, as
FakeOs::windowreturns it. - FakeOs
- A fake system: the answers its dialogs give, and what the handlers did.
- Shown
Dialog - A dialog a handler showed, as
FakeOs::dialogsreturns it. - Shown
Message - A message box a handler showed, as
FakeOs::messagesreturns it.
Enums§
- Choice
- The button a test chooses in a message box, with
FakeOs::choose. - Dialog
Kind - Which method of
Dialogshowed a dialog. - Message
Kind - Which method of
Osshowed a message box.