Adjust editor tests to use input APIs instead of key events
This commit is contained in:
parent
0185b4fef4
commit
372c3eed52
2 changed files with 14 additions and 6 deletions
|
@ -139,6 +139,12 @@ impl<'a> EditorTestContext<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn simulate_input(&mut self, input: &str) {
|
||||
self.editor.update(self.cx, |editor, cx| {
|
||||
editor.handle_input(input, cx);
|
||||
});
|
||||
}
|
||||
|
||||
pub fn simulate_keystroke(&mut self, keystroke_text: &str) {
|
||||
let keystroke = Keystroke::parse(keystroke_text).unwrap();
|
||||
self.cx.dispatch_keystroke(self.window_id, keystroke, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue