Persist closed account tabs and add scoped account removal

This commit is contained in:
AttilaNet
2026-11-08 11:32:52 +08:00
parent dba667f21d
commit e3d806a167
5 changed files with 412 additions and 16 deletions
+25
View File
@@ -208,6 +208,31 @@ class AccountGuiTests(unittest.TestCase):
finally:
hub.close()
def test_closed_tab_stays_closed_after_restart_and_can_be_opened_manually(self):
with workspace_temp() as folder:
hub = AccountsWindow(folder)
hub.add_profile()
for window in hub.windows.values():
window.timer.stop()
self.wait(list(hub.windows.values()))
closed = hub.profiles[-1]
hub.close_profile(hub.tabs.count() - 1)
hub.close()
restarted = AccountsWindow(folder)
for window in restarted.windows.values():
window.timer.stop()
try:
self.wait(list(restarted.windows.values()))
self.assertNotIn(closed["id"], restarted.windows)
self.assertTrue(any(p["id"] == closed["id"] for p in restarted.profiles))
restarted.open_profile(next(p for p in restarted.profiles if p["id"] == closed["id"]))
for window in restarted.windows.values():
window.timer.stop()
self.wait(list(restarted.windows.values()))
self.assertIn(closed["id"], restarted.windows)
finally:
restarted.close()
def test_failed_resume_saves_counters_before_response_and_keeps_execution_off(self):
with workspace_temp() as folder:
window = gui.Window(folder)