diff options
author | Tim Oram <dev@mitmaro.ca> | 2021-05-31 09:32:46 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2021-06-12 11:06:54 -0230 |
commit | 1a05e74852e938f1d462a9ab8fb1f46507a6f4e7 (patch) | |
tree | af97b38627a8b9ea1ddb8745dc142bfa24010738 /src/confirm_rebase | |
parent | 92f0349f8518855276d6c314c59bd0b3e08bad98 (diff) |
Remove ViewState
The ViewState is no longer used in the tests and can be safely removed.
Diffstat (limited to 'src/confirm_rebase')
-rw-r--r-- | src/confirm_rebase/mod.rs | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/confirm_rebase/mod.rs b/src/confirm_rebase/mod.rs index 039e829..a047623 100644 --- a/src/confirm_rebase/mod.rs +++ b/src/confirm_rebase/mod.rs @@ -47,36 +47,30 @@ mod tests { assert_process_result, assert_rendered_output, input::{Event, KeyCode, MetaEvent}, - process::testutil::{process_module_test, TestContext, ViewState}, + process::testutil::{process_module_test, TestContext}, }; #[test] fn build_view_data() { - process_module_test( - &["pick aaa comment"], - ViewState::default(), - &[], - |test_context: TestContext<'_>| { - let mut module = ConfirmRebase::new( - &test_context.config.key_bindings.confirm_yes, - &test_context.config.key_bindings.confirm_no, - ); - let view_data = test_context.build_view_data(&mut module); - assert_rendered_output!( - view_data, - "{TITLE}", - "{BODY}", - "{Normal}Are you sure you want to rebase (y/n)? " - ); - }, - ); + process_module_test(&["pick aaa comment"], &[], |test_context: TestContext<'_>| { + let mut module = ConfirmRebase::new( + &test_context.config.key_bindings.confirm_yes, + &test_context.config.key_bindings.confirm_no, + ); + let view_data = test_context.build_view_data(&mut module); + assert_rendered_output!( + view_data, + "{TITLE}", + "{BODY}", + "{Normal}Are you sure you want to rebase (y/n)? " + ); + }); } #[test] fn handle_event_yes() { process_module_test( &["pick aaa comment"], - ViewState::default(), &[Event::from(MetaEvent::Yes)], |mut test_context: TestContext<'_>| { let mut module = ConfirmRebase::new( @@ -97,7 +91,6 @@ mod tests { fn handle_event_no() { process_module_test( &["pick aaa comment"], - ViewState::default(), &[Event::from(MetaEvent::No)], |mut test_context: TestContext<'_>| { let mut module = ConfirmRebase::new( @@ -117,7 +110,6 @@ mod tests { fn handle_event_no_match_key() { process_module_test( &["pick aaa comment"], - ViewState::default(), &[Event::from(KeyCode::Null)], |mut test_context: TestContext<'_>| { let mut module = ConfirmRebase::new( |