summaryrefslogtreecommitdiff
path: root/internal/tui/reader_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 16:30:09 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 16:30:09 +0200
commit3eb99c1dd63565fbc1f5bf5af7fc8e835aad182e (patch)
tree582de9d901edf8c6efe541e69ee3075c6eedf714 /internal/tui/reader_test.go
parent19e02a3290dc78de088f9a72fb9c16dbf6517ffc (diff)
downloadlectio-3eb99c1dd63565fbc1f5bf5af7fc8e835aad182e.tar.gz
lectio-3eb99c1dd63565fbc1f5bf5af7fc8e835aad182e.zip
tui reader: bookmark note+tags as a prominent centered modal (tab switches fields), delete confirmation as a modal; v0.20.0
Diffstat (limited to 'internal/tui/reader_test.go')
-rw-r--r--internal/tui/reader_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/tui/reader_test.go b/internal/tui/reader_test.go
index f3e43d5..904836e 100644
--- a/internal/tui/reader_test.go
+++ b/internal/tui/reader_test.go
@@ -124,8 +124,10 @@ func TestReaderBookmarkFlow(t *testing.T) {
if m.mode != modeMark {
t.Fatal("enter did not open the note box")
}
- m = key(m, runes("hi"))
- m = key(m, tea.KeyMsg{Type: tea.KeyEnter})
+ m = key(m, runes("hi")) // note field
+ m = key(m, tea.KeyMsg{Type: tea.KeyTab}) // switch to tags field
+ m = key(m, runes("grace")) // tags field
+ m = key(m, tea.KeyMsg{Type: tea.KeyEnter}) // save
if m.mode != modeRead {
t.Fatal("enter did not save + return to reading")
}
@@ -134,8 +136,9 @@ func TestReaderBookmarkFlow(t *testing.T) {
if m.mode != modeBookmarks || len(m.marks) != 1 {
t.Fatalf("bookmarks mode=%v n=%d", m.mode, len(m.marks))
}
- if m.marks[0].Book != "John" || m.marks[0].Verse != 2 || m.marks[0].Note != "hi" {
- t.Errorf("mark = %+v (want John 1:2 note hi)", m.marks[0])
+ if m.marks[0].Book != "John" || m.marks[0].Verse != 2 || m.marks[0].Note != "hi" ||
+ len(m.marks[0].Tags) != 1 || m.marks[0].Tags[0] != "grace" {
+ t.Errorf("mark = %+v (want John 1:2 note hi tag grace)", m.marks[0])
}
if !strings.Contains(m.View(), "John") {
t.Errorf("bookmarks view missing John:\n%s", m.View())