summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/todos/src/main.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 8772bb80..51d09962 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -593,15 +593,12 @@ mod tests {
use iced::test::selector;
#[test]
- fn it_creates_a_new_task() {
+ fn it_creates_a_new_task() -> Result<(), test::Error> {
let (mut todos, _command) = Todos::new();
let _command = todos.update(Message::Loaded(Err(LoadError::File)));
let mut interface = test::interface(todos.view());
-
- let _input = interface
- .click("new-task")
- .expect("new-task input must be present");
+ let _input = interface.click("new-task")?;
interface.typewrite("Create the universe");
interface.press_key(keyboard::key::Named::Enter);
@@ -611,9 +608,8 @@ mod tests {
}
let mut interface = test::interface(todos.view());
+ let _ = interface.find(selector::text("Create the universe"))?;
- let _ = interface
- .find(selector::text("Create the universe"))
- .expect("New task must be present");
+ Ok(())
}
}