tui2: add dedicated npub palette command parity

This commit is contained in:
thePR0M3TH3AN committed 2026-03-02 08:54:45 -05:00
1 parent 37242294ed
commit 99b6f77e2b
6 files changed
+87 -7

No files matched your search

+1
View File
@@ -552,6 +552,7 @@ async def test_tui2_matrix_actions_palette_events_and_guards() -> None:
app._run_palette_command("setting-kdf-iterations 100000")
app._run_palette_command("setting-kdf-mode pbkdf2")
app._run_palette_command("relay-list")
app._run_palette_command("npub")
app._run_palette_command("relay-add wss://relay.example")
app._run_palette_command("relay-rm 1")
app._run_palette_command("relay-reset")
@@ -457,6 +457,10 @@ class FakeNostrService:
def __init__(self, relays: list[str]) -> None:
self.relays = list(relays)
self.account_idx = 0
self.pubkey = "npub1seedpassprofile"
def get_pubkey(self) -> str:
return str(self.pubkey)
def list_relays(self) -> list[str]:
return list(self.relays)
@@ -1413,6 +1417,11 @@ async def test_tui2_textual_profiles_and_settings_palette_commands() -> None:
await pilot.pause()
assert "Relays (2): wss://r1, wss://r2" in _status_text(app)
app._run_palette_command("npub")
await pilot.pause()
assert "Displayed active Nostr pubkey" in _status_text(app)
assert "npub: npub1seedpassprofile" in _widget_text(app, "#secret-detail")
app._run_palette_command("relay-add wss://r3")
await pilot.pause()
assert "Added relay wss://r3" in _status_text(app)
@@ -1588,6 +1597,10 @@ async def test_tui2_textual_profiles_and_settings_palette_validation() -> None:
await pilot.pause()
assert "Nostr service unavailable" in _status_text(app)
app._run_palette_command("npub")
await pilot.pause()
assert "Nostr service unavailable" in _status_text(app)
app._run_palette_command("relay-reset")
await pilot.pause()
assert "Nostr service unavailable" in _status_text(app)
@@ -1659,6 +1672,10 @@ async def test_tui2_textual_profiles_and_settings_palette_validation() -> None:
await pilot.pause()
assert "Usage: nostr-fresh-namespace" in _status_text(app)
app._run_palette_command("npub now")
await pilot.pause()
assert "Usage: npub" in _status_text(app)
app._run_palette_command("managed-load 1 2")
await pilot.pause()
assert "Usage: managed-load (optional: entry_id)" in _status_text(app)