mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-30 09:22:03 +00:00
Fix managed_account QR exclusion and bare except in action_bar
- Remove 'qr' from managed_account context actions (accounts don't expose a QR-scannable key like seeds/nostr do) - Change bare 'except:' to 'except Exception:' on vault manager check - Add test_v3_action_bar_managed_account_excludes_qr in parity tests Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
8dbb8e065c
commit
ea5ad1f093
2 files changed
+28
-2
No files matched your search
@@ -34,7 +34,7 @@ class ActionBar(Static):
|
||||
len(getattr(app.services.get("vault")._manager, "profile_stack", []))
|
||||
> 0
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
exit_hint = (
|
||||
@@ -113,7 +113,6 @@ class ActionBar(Static):
|
||||
],
|
||||
"managed_account": [
|
||||
"reveal",
|
||||
"qr",
|
||||
"edit",
|
||||
"archive",
|
||||
"delete",
|
||||
|
||||
@@ -336,3 +336,30 @@ async def test_v3_action_bar_only_shows_context_actions_for_selected_kind() -> N
|
||||
assert "Load" in rendered
|
||||
assert "Delete" in rendered
|
||||
assert "Export" not in rendered
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_v3_action_bar_managed_account_excludes_qr() -> None:
|
||||
app = SeedPassTuiV3(
|
||||
entry_service_factory=lambda: MockEntryService(),
|
||||
vault_service_factory=lambda: MockVaultService(),
|
||||
)
|
||||
# Inject a managed_account entry into the mock service
|
||||
async with app.run_test() as pilot:
|
||||
await pilot.pause()
|
||||
app.services["entry"].entries[99] = {
|
||||
"id": 99,
|
||||
"label": "test-managed",
|
||||
"kind": "managed_account",
|
||||
"index": 0,
|
||||
}
|
||||
bar = app.screen.query_one("#action-bar")
|
||||
|
||||
app.selected_entry_id = 99
|
||||
await pilot.pause()
|
||||
rendered = Text.from_markup(bar.render()).plain.splitlines()[1]
|
||||
assert "Context (managed_account):" in rendered
|
||||
assert "Reveal" in rendered
|
||||
assert "Load" in rendered
|
||||
assert "Delete" in rendered
|
||||
assert " QR" not in rendered
|
||||
Reference in new issue
Block a user