Skip to content

Commit

Permalink
💚 tests fix and lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed May 20, 2024
1 parent 69f6407 commit 10604d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
3 changes: 0 additions & 3 deletions mvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (

func (m *Model) Init() tea.Cmd {

if IsCI() {
}

var cmds []tea.Cmd
for i := range m.Runners {
if (m.Runners)[i].Spinner != nil {
Expand Down
39 changes: 21 additions & 18 deletions mvc_test.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
package taskin

import (
"os"
"testing"
)

func TestRunners_Init(t *testing.T) {
r := &Runners{
// Initialize your Runners struct here
}
func TestModelInit(t *testing.T) {
// Initialize a new Model
m := &Model{}

cmd := r.Init()
// Call the Init method
cmd := m.Init()

// If Init is not implemented, it should return nil
// Check if the returned command is not nil
if cmd != nil {
t.Errorf("Expected Init to return nil")
t.Errorf("Expected command to be not nil, got not nil")
}
}

func TestRunners_View(t *testing.T) {
r := &Runners{
// Initialize your Runners struct here
}
func TestModelUpdate(t *testing.T) {
// Initialize a new Model
m := &Model{}

// Set the "CI" environment variable
os.Setenv("CI", "true")
// Call the Update method with a dummy message
newModel, cmd := m.Update("dummy message")

view := r.View()
// Check if the returned model is not nil
if newModel == nil {
t.Errorf("Expected model to be not nil, got nil")
}

// If "CI" is set and not all tasks are completed, View should return an empty string
if view != "" {
t.Errorf("Expected View to return an empty string")
// Check if the returned command is nil
if cmd != nil {
t.Errorf("Expected command to be nil, got non-nil")
}
}

// Add more tests for other methods in the Model struct

0 comments on commit 10604d7

Please sign in to comment.