Skip to content

Commit

Permalink
test(searchLabel_test): fixing error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneSemCalda committed Jan 26, 2024
1 parent 4c3d32d commit f53bf7d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Tui/searchLabel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)

func TestSearchLabelModelUpdate(t *testing.T) {
Expand All @@ -17,7 +18,13 @@ func TestSearchLabelModelUpdate(t *testing.T) {

func TestSearchLabelModelView(t *testing.T) {
m := &searchLabelModel{choice: "Naruto"}
expected := "Enter the name of the anime to be downloaded: Naruto"
expected := lipgloss.NewStyle().
Foreground(lipgloss.Color("#00FF00")).
Bold(true).
Border(lipgloss.RoundedBorder()).
Padding(1).
Width(50).
Render("Enter the name of the anime to be downloaded: Naruto")
if m.View() != expected {
t.Errorf("Expected %v, got %v", expected, m.View())
}
Expand All @@ -44,7 +51,7 @@ func TestUpdateWithCharacter(t *testing.T) {
func TestInit(t *testing.T) {
m := &searchLabelModel{}
cmd := m.Init()
if cmd != nil {
t.Errorf("Expected cmd to be nil, got %v", cmd)
if cmd == nil {
t.Errorf("Expected cmd to not be nil")
}
}

0 comments on commit f53bf7d

Please sign in to comment.