Ensure the SettingsStore global is added in tests

This commit is contained in:
Max Brunsfeld 2023-05-10 16:39:59 -07:00
parent 68867fe2e1
commit cee7edabf9
10 changed files with 61 additions and 32 deletions

View file

@ -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 {