Add popup notifications, log view (F5) and context-sensitive key hints (M9)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
func TestPlainText(t *testing.T) {
|
||||
for _, tc := range []struct{ in, want string }{
|
||||
{"[green]Done[-]", "Done"},
|
||||
{"[red]" + tview.Escape("Movie [1080p] failed"), "Movie [1080p] failed"},
|
||||
{"plain", "plain"},
|
||||
{"[yellow]a [::b]b[::-]", "a b"},
|
||||
} {
|
||||
if got := plainText(tc.in); got != tc.want {
|
||||
t.Errorf("plainText(%q) = %q, want %q", tc.in, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestToastProgress(t *testing.T) {
|
||||
if !(toast{text: "Searching…"}).progress() || (toast{text: "Done"}).progress() {
|
||||
t.Error("progress detection wrong")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user