Ensure the SettingsStore global is added in tests
This commit is contained in:
@@ -19,7 +19,7 @@ use gpui::{
|
||||
use language::LanguageRegistry;
|
||||
use parking_lot::Mutex;
|
||||
use project::{Project, WorktreeId};
|
||||
use settings::Settings;
|
||||
use settings::{Settings, SettingsStore};
|
||||
use std::{
|
||||
cell::{Ref, RefCell, RefMut},
|
||||
env,
|
||||
@@ -102,6 +102,7 @@ impl TestServer {
|
||||
|
||||
async fn create_client(&mut self, cx: &mut TestAppContext, name: &str) -> TestClient {
|
||||
cx.update(|cx| {
|
||||
cx.set_global(SettingsStore::test(cx));
|
||||
cx.set_global(Settings::test(cx));
|
||||
});
|
||||
|
||||
@@ -185,6 +186,8 @@ impl TestServer {
|
||||
})
|
||||
});
|
||||
|
||||
cx.update(|cx| client::init(&client, cx));
|
||||
|
||||
let fs = FakeFs::new(cx.background());
|
||||
let user_store = cx.add_model(|cx| UserStore::new(client.clone(), http, cx));
|
||||
let app_state = Arc::new(workspace::AppState {
|
||||
|
||||
@@ -20,7 +20,7 @@ use rand::{
|
||||
prelude::*,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::Settings;
|
||||
use settings::{Settings, SettingsStore};
|
||||
use std::{
|
||||
env,
|
||||
ops::Range,
|
||||
@@ -148,8 +148,11 @@ async fn test_random_collaboration(
|
||||
|
||||
for (client, mut cx) in clients {
|
||||
cx.update(|cx| {
|
||||
let store = cx.remove_global::<SettingsStore>();
|
||||
let settings = cx.remove_global::<Settings>();
|
||||
cx.clear_globals();
|
||||
cx.set_global(Settings::test(cx));
|
||||
cx.set_global(store);
|
||||
cx.set_global(settings);
|
||||
drop(client);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user