pause after showing entry details

This commit is contained in:
thePR0M3TH3AN
2025-07-14 22:34:04 -04:00
parent bdf83fabd8
commit 4d559d0339
2 changed files with 11 additions and 4 deletions

View File

@@ -1792,7 +1792,7 @@ class PasswordManager:
pause()
def show_entry_details_by_index(self, index: int) -> None:
"""Display entry details for ``index`` without prompting."""
"""Display details for entry ``index`` and offer actions."""
try:
entry = self.entry_manager.retrieve_entry(index)
if not entry:
@@ -1808,6 +1808,7 @@ class PasswordManager:
)
self.display_entry_details(index)
pause()
self._entry_actions_menu(index, entry)
except Exception as e:
logging.error(f"Failed to display entry details: {e}", exc_info=True)

View File

@@ -116,15 +116,21 @@ def test_show_entry_details_by_index(monkeypatch):
"password_manager.manager.clear_header_with_notification",
lambda *a, **k: header_calls.append(True),
)
action_calls = []
call_order = []
monkeypatch.setattr(
pm,
"display_entry_details",
lambda *a, **k: call_order.append("display"),
)
monkeypatch.setattr(
pm,
"_entry_actions_menu",
lambda *a, **k: action_calls.append(True),
lambda *a, **k: call_order.append("actions"),
)
monkeypatch.setattr("password_manager.manager.pause", lambda *a, **k: None)
pm.show_entry_details_by_index(index)
assert len(header_calls) == 1
assert len(action_calls) == 1
assert call_order == ["display", "actions"]