Archive closed browser tabs
This commit is contained in:
@@ -67,6 +67,23 @@ fn close_tab_command_closes_active_tab() -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn restore_tab_command_reopens_last_archived_tab() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
let closed_tab_id = core.open_tab(UrlText::parse("https://example.com")?);
|
||||
core.close_active_tab()?;
|
||||
|
||||
core.set_command_query(">restore-tab");
|
||||
let intent = core.submit_command()?;
|
||||
let snapshot = core.snapshot()?;
|
||||
|
||||
assert_eq!(intent, Some(CommandIntent::Command("restore-tab".to_string())));
|
||||
assert_eq!(snapshot.active_tab_id, closed_tab_id);
|
||||
assert!(snapshot.archived_tabs.is_empty());
|
||||
assert_eq!(snapshot.command_query, "");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unknown_command_preserves_query() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
|
||||
Reference in New Issue
Block a user