feat: switch between provider sessions without restarting
This commit is contained in:
@@ -15,6 +15,29 @@ fn press(
|
||||
bindings.resolve(context, KeyEvent::new(code, modifiers))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn provider_choice_is_configurable_and_normal_only() {
|
||||
let defaults = Bindings::default();
|
||||
let overrides = configured("[keys.app]\nprovider = 'alt+p'\n").unwrap();
|
||||
for &context in ALL {
|
||||
let expected = matches!(context, Context::Normal | Context::CollectionNormal)
|
||||
.then_some(Action::ProviderChoose);
|
||||
assert_eq!(
|
||||
press(&defaults, context, KeyCode::Char('p'), KeyModifiers::NONE)
|
||||
.filter(|action| *action == Action::ProviderChoose),
|
||||
expected,
|
||||
);
|
||||
assert_eq!(
|
||||
press(&overrides, context, KeyCode::Char('p'), KeyModifiers::ALT),
|
||||
expected,
|
||||
);
|
||||
assert_ne!(
|
||||
press(&overrides, context, KeyCode::Char('p'), KeyModifiers::NONE),
|
||||
Some(Action::ProviderChoose),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_section_headers_are_bold_in_the_grouped_overview() {
|
||||
use ratatui::{
|
||||
|
||||
Reference in New Issue
Block a user