mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-10 23:00:44 +00:00
fix(tui-v2): handle non-existent entries and tree nav focus feedback
Opening a non-existent entry now shows "Entry not found" instead of rendering a broken empty board. Tree navigation commands now give clear feedback when focus is on wrong pane or sidebar is collapsed. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
08e71bd1b4
commit
6f2b9a6d18
4 files changed
+82
-2
No files matched your search
@@ -1583,6 +1583,45 @@ async def test_tui2_textual_password_board_uses_card_sections() -> None:
|
||||
assert "+- Quick Actions " in board
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_tui2_textual_open_nonexistent_entry_shows_not_found() -> None:
|
||||
service = FakeEntryService(
|
||||
[{"id": 1, "kind": "password", "label": "Login 1", "length": 16}]
|
||||
)
|
||||
app = _build_app(service)
|
||||
|
||||
async with app.run_test() as pilot:
|
||||
await pilot.pause()
|
||||
app._run_palette_command("open 999")
|
||||
await pilot.pause()
|
||||
board = _widget_text(app, "#entry-detail")
|
||||
assert "not found" in board.lower()
|
||||
status_text = _widget_text(app, "#status")
|
||||
assert "not found" in status_text.lower()
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_tui2_textual_tree_nav_feedback_when_wrong_pane() -> None:
|
||||
service = FakeEntryService(
|
||||
[{"id": 1, "kind": "password", "label": "Login 1", "length": 16}]
|
||||
)
|
||||
profile_service = FakeProfileService(["fp-default"])
|
||||
app = _build_app(service, profile_service=profile_service)
|
||||
|
||||
async with app.run_test() as pilot:
|
||||
await pilot.pause()
|
||||
# Focus is on center by default, tree-next should give feedback
|
||||
app._run_palette_command("profile-tree-next")
|
||||
await pilot.pause()
|
||||
status_text = _widget_text(app, "#status")
|
||||
assert "focus" in status_text.lower() or "left" in status_text.lower()
|
||||
|
||||
app._run_palette_command("profile-tree-open")
|
||||
await pilot.pause()
|
||||
status_text = _widget_text(app, "#status")
|
||||
assert "focus" in status_text.lower() or "left" in status_text.lower()
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_tui2_textual_filters_panel_tracks_selected_entry() -> None:
|
||||
service = FakeEntryService(
|
||||
|
||||
Reference in new issue
Block a user