feat: support multiple video selection
This commit is contained in:
@@ -15,6 +15,51 @@ fn press(
|
||||
bindings.resolve(context, KeyEvent::new(code, modifiers))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn playback_checks_are_configurable_in_views_without_stealing_modal_space() {
|
||||
let defaults = Bindings::default();
|
||||
let overrides = configured("[keys.video.select]\ntoggle = 'f20'\nclear = 'f21'\n").unwrap();
|
||||
for &context in ALL {
|
||||
for (action, modifiers, override_code) in [
|
||||
(Action::VideoToggle, KeyModifiers::NONE, KeyCode::F(20)),
|
||||
(Action::VideoClear, KeyModifiers::CONTROL, KeyCode::F(21)),
|
||||
] {
|
||||
let expected = VIEW.contains(&context).then_some(action);
|
||||
assert_eq!(
|
||||
press(&defaults, context, KeyCode::Char(' '), modifiers)
|
||||
.filter(|resolved| *resolved == action),
|
||||
expected,
|
||||
);
|
||||
assert_eq!(
|
||||
press(&overrides, context, override_code, KeyModifiers::NONE),
|
||||
expected,
|
||||
);
|
||||
assert_ne!(
|
||||
press(&overrides, context, KeyCode::Char(' '), modifiers),
|
||||
Some(action),
|
||||
);
|
||||
}
|
||||
}
|
||||
assert_eq!(
|
||||
press(
|
||||
&defaults,
|
||||
Context::TagList,
|
||||
KeyCode::Char(' '),
|
||||
KeyModifiers::NONE
|
||||
),
|
||||
Some(Action::TagToggle),
|
||||
);
|
||||
assert_eq!(
|
||||
press(
|
||||
&defaults,
|
||||
Context::SelectorNormal,
|
||||
KeyCode::Char(' '),
|
||||
KeyModifiers::NONE
|
||||
),
|
||||
Some(Action::SelectorToggle),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn provider_choice_is_configurable_and_normal_only() {
|
||||
let defaults = Bindings::default();
|
||||
|
||||
Reference in New Issue
Block a user