Hoisted assert clipboard into TestAppContext
This commit is contained in:
parent
9209c0dfeb
commit
2a6e23ff28
4 changed files with 9 additions and 17 deletions
|
@ -627,6 +627,14 @@ impl TestAppContext {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn assert_clipboard_content(&mut self, expected_content: Option<&str>) {
|
||||
self.update(|cx| {
|
||||
let actual_content = cx.read_from_clipboard().map(|item| item.text().to_owned());
|
||||
let expected_content = expected_content.map(|content| content.to_owned());
|
||||
assert_eq!(actual_content, expected_content);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncAppContext {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue