Add pinned tab controls

This commit is contained in:
2026-05-07 19:47:27 -04:00
parent 0f372c5fc0
commit 82df2b4502
8 changed files with 163 additions and 2 deletions
+32
View File
@@ -155,6 +155,38 @@ fn toggles_active_tab_favorite() -> Result<(), Box<dyn Error>> {
Ok(())
}
#[test]
fn toggles_active_tab_pinned() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
let pinned = core.toggle_active_tab_pinned()?;
let snapshot = core.snapshot()?;
assert!(pinned);
assert_eq!(snapshot.pinned_tabs.len(), 1);
assert_eq!(snapshot.pinned_tabs[0].id(), &snapshot.active_tab_id);
let pinned = core.toggle_active_tab_pinned()?;
let snapshot = core.snapshot()?;
assert!(!pinned);
assert!(snapshot.pinned_tabs.is_empty());
Ok(())
}
#[test]
fn favorite_tabs_are_omitted_from_pinned_section() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
core.toggle_active_tab_pinned()?;
core.toggle_active_tab_favorite()?;
let snapshot = core.snapshot()?;
assert_eq!(snapshot.favorites.len(), 1);
assert!(snapshot.pinned_tabs.is_empty());
Ok(())
}
#[test]
fn enforces_default_favorite_limit() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;