diff options
Diffstat (limited to 'internal/tui/reader_test.go')
| -rw-r--r-- | internal/tui/reader_test.go | 11 |
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()) |
