tui2: add quickstart and stats parity UX flows

This commit is contained in:
thePR0M3TH3AN committed 2026-03-02 09:31:56 -05:00
1 parent 3f0d4a8d89
commit 5c524b2086
6 files changed
+229 -6

No files matched your search

+4
View File
@@ -505,6 +505,8 @@ async def test_tui2_matrix_actions_palette_events_and_guards() -> None:
app._run_palette_command("page abc")
app._run_palette_command("page 0")
app._run_palette_command("help-commands now")
app._run_palette_command("quickstart now")
app._run_palette_command("stats now")
app._run_palette_command("link-filter")
app._run_palette_command("link-add")
app._run_palette_command("link-add no")
@@ -579,6 +581,8 @@ async def test_tui2_matrix_actions_palette_events_and_guards() -> None:
app._run_palette_command("help")
app._run_palette_command("help-commands")
app._run_palette_command("quickstart")
app._run_palette_command("stats")
app._run_palette_command("search Doc")
app._run_palette_command("filter document")
app._run_palette_command("archive-filter all")
@@ -758,6 +758,47 @@ async def test_tui2_textual_palette_help_commands_reference() -> None:
assert "Palette commands:" in _status_text(app)
@pytest.mark.anyio
async def test_tui2_textual_quickstart_and_stats_commands() -> None:
service = FakeEntryService(
[
{"id": 1, "kind": "password", "label": "Login 1", "length": 16},
{"id": 2, "kind": "document", "label": "Doc 2", "content": "x"},
{"id": 3, "kind": "totp", "label": "Auth 3", "secret": "JBSWY3DPEHPK3PXP"},
{"id": 4, "kind": "seed", "label": "Seed 4", "archived": True},
]
)
app = _build_app(service)
async with app.run_test() as pilot:
await pilot.pause()
await _run_palette(app, pilot, "quickstart")
detail = _widget_text(app, "#entry-detail")
assert "Quick Start" in detail
assert "add-password" in detail
assert "Displayed quick start guide" in _status_text(app)
await _run_palette(app, pilot, "stats")
detail = _widget_text(app, "#entry-detail")
assert "Vault Stats" in detail
assert "Total entries: 4" in detail
assert "Archived entries: 1" in detail
assert "- password: 1" in detail
assert "Displayed vault stats" in _status_text(app)
@pytest.mark.anyio
async def test_tui2_textual_empty_vault_shows_quickstart() -> None:
app = _build_app(FakeEntryService([]))
async with app.run_test() as pilot:
await pilot.pause()
detail = _widget_text(app, "#entry-detail")
assert "Quick Start" in detail
assert "add-password" in detail
assert "Vault is empty." in _status_text(app)
@pytest.mark.anyio
async def test_tui2_textual_reveal_and_qr_flow() -> None:
service = FakeEntryService(