Add command palette tests and simulate_keystrokes
This commit is contained in:
parent
e37d7f5b0e
commit
91b54b352b
6 changed files with 180 additions and 119 deletions
|
@ -54,6 +54,9 @@ pub trait Action: std::fmt::Debug + 'static {
|
|||
where
|
||||
Self: Sized;
|
||||
fn build(value: Option<serde_json::Value>) -> Result<Box<dyn Action>>
|
||||
where
|
||||
Self: Sized;
|
||||
fn is_registered() -> bool
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
|
@ -88,6 +91,14 @@ where
|
|||
Ok(Box::new(action))
|
||||
}
|
||||
|
||||
fn is_registered() -> bool {
|
||||
ACTION_REGISTRY
|
||||
.read()
|
||||
.names_by_type_id
|
||||
.get(&TypeId::of::<A>())
|
||||
.is_some()
|
||||
}
|
||||
|
||||
fn partial_eq(&self, action: &dyn Action) -> bool {
|
||||
action
|
||||
.as_any()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue