mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-09 17:44:08 +00:00
Merge pull request #5723 from mockydevs/fix/font-menu-test-race-5647
Tests: the Type › Font menu test waits for the installed fonts' scan (#5647)
This commit is contained in:
@@ -9,6 +9,10 @@ use crate::{VectorcraftApp, menus};
|
||||
#[test]
|
||||
fn type_font_menu_lists_every_available_family() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
// The app starts the installed fonts' scan, and until it ends Type › Font lists only the
|
||||
// loaded fonts (#5483). The scan changes the generation a moment before it counts as done, so
|
||||
// a read in between sees the old list under the new generation: wait for it to end first.
|
||||
FontDb::global().family_list();
|
||||
app.run("file.new", json!({})).unwrap();
|
||||
let fonts = |app: &VectorcraftApp| -> Vec<String> {
|
||||
menus::menu_entries(app).into_iter().filter(|e| e.path == ["Type", "Font"]).map(|e| e.label).collect()
|
||||
|
||||
Reference in New Issue
Block a user