refactor: Created dedicated proptests and assertions to clean up the handler unit tests

This commit is contained in:
2025-12-04 22:57:06 -07:00
parent 35dce0bf01
commit 49fd086b92
46 changed files with 1023 additions and 1018 deletions
+36
View File
@@ -452,4 +452,40 @@ mod test_utils {
assert!(app.should_refresh);
};
}
#[macro_export]
macro_rules! assert_modal_present {
($modal:expr) => {
assert!($modal.is_some(), "Expected modal to be present");
};
}
#[macro_export]
macro_rules! assert_modal_absent {
($modal:expr) => {
assert!($modal.is_none(), "Expected modal to be absent");
};
}
#[macro_export]
macro_rules! assert_navigation_pushed {
($app:expr, $expected_route:expr) => {
pretty_assertions::assert_eq!(
$app.get_current_route(),
$expected_route,
"Expected route to be pushed onto navigation stack"
);
};
}
#[macro_export]
macro_rules! assert_navigation_popped {
($app:expr, $expected_route:expr) => {
pretty_assertions::assert_eq!(
$app.get_current_route(),
$expected_route,
"Expected route after popping navigation stack"
);
};
}
}