Add basic space switching

This commit is contained in:
2026-05-07 20:19:55 -04:00
parent 42d33ac06c
commit 19d928859c
9 changed files with 325 additions and 72 deletions
+19
View File
@@ -49,6 +49,25 @@ fn new_tab_command_opens_new_tab() -> Result<(), Box<dyn Error>> {
Ok(())
}
#[test]
fn new_space_command_creates_and_selects_named_space() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
core.set_command_query(">new-space Research");
let intent = core.submit_command()?;
let snapshot = core.snapshot()?;
let active_tab = core.active_tab()?;
assert_eq!(intent, Some(CommandIntent::Command("new-space Research".to_string())));
assert_eq!(snapshot.spaces.len(), 2);
assert_eq!(snapshot.active_space_name, "Research");
assert_eq!(snapshot.tabs.len(), 1);
assert_eq!(snapshot.tabs[0].space_id(), &snapshot.active_space_id);
assert_eq!(active_tab.url().as_str(), "ely://new-tab");
assert_eq!(snapshot.command_query, "");
Ok(())
}
#[test]
fn close_tab_command_closes_active_tab() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;