Add sync settings status page

This commit is contained in:
2026-05-08 00:16:56 -04:00
parent f10a2349f6
commit 479737a8b2
10 changed files with 358 additions and 2 deletions
+15
View File
@@ -96,6 +96,21 @@ fn open_settings_command_opens_settings_page() -> Result<(), Box<dyn Error>> {
Ok(())
}
#[test]
fn open_sync_status_command_opens_sync_settings_page() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
core.set_command_query(">open-sync-status");
let intent = core.submit_command()?;
let active_tab = core.active_tab()?;
assert_eq!(intent, Some(CommandIntent::Command("open-sync-status".to_string())));
assert_eq!(active_tab.title(), "Sync Settings");
assert_eq!(active_tab.url().as_str(), "ely://settings/sync");
assert_eq!(core.snapshot()?.command_query, "");
Ok(())
}
#[test]
fn settings_scoped_search_opens_matching_settings_page() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
+29
View File
@@ -0,0 +1,29 @@
use std::error::Error;
use ely_browser_core::{BrowserCore, InitialBrowserConfig};
use ely_domain::{SyncConnectionState, SyncObjectKind, SyncObjectState, SyncObjectStatus, UrlText};
#[test]
fn default_sync_status_reflects_local_browser_state() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
core.create_space("Research", "R", 0xf54e00)?;
core.open_tab(UrlText::parse("https://example.com/research")?);
let snapshot = core.snapshot()?;
let status = &snapshot.sync_status;
assert_eq!(status.connection(), &SyncConnectionState::SignedOut);
assert_eq!(status.pending_objects(), 0);
assert_eq!(status.failed_objects(), 0);
assert_eq!(
status.objects(),
&[
SyncObjectStatus::new(SyncObjectKind::Spaces, 2, SyncObjectState::LocalOnly),
SyncObjectStatus::new(SyncObjectKind::Tabs, 3, SyncObjectState::LocalOnly),
SyncObjectStatus::new(SyncObjectKind::Profiles, 1, SyncObjectState::LocalOnly),
SyncObjectStatus::new(SyncObjectKind::History, 1, SyncObjectState::PrivacyControlled),
SyncObjectStatus::new(SyncObjectKind::PluginSettings, 0, SyncObjectState::LocalOnly),
],
);
Ok(())
}