Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boozec committed Nov 20, 2023
1 parent 5579a07 commit 1e14b20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions commands/uni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func TestGetTimeTable(t *testing.T) {
courseName string
year int
day time.Time
curriculum string
}
tests := []struct {
name string
Expand All @@ -130,6 +131,7 @@ func TestGetTimeTable(t *testing.T) {
courseName: "informatica",
year: 1,
day: time.Date(2023, 11, 20, 0, 0, 0, 0, time.UTC),
curriculum: "",
},
want: `🕘`,
},
Expand All @@ -155,7 +157,7 @@ func TestGetTimeTable(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := GetTimeTable(tt.args.courseType, tt.args.courseName, tt.args.year, tt.args.day)
got, err := GetTimeTable(tt.args.courseType, tt.args.courseName, tt.args.curriculum, tt.args.year, tt.args.day)
if err != nil && !tt.error {
t.Errorf("GetTimeTable() error = %v", err)
return
Expand All @@ -173,7 +175,7 @@ func TestGetTimeTable(t *testing.T) {
func TestWeekend(t *testing.T) {

date := time.Date(2023, 3, 11, 0, 0, 0, 0, time.UTC)
result, err := GetTimeTable("laurea", "informatica", 1, date)
result, err := GetTimeTable("laurea", "informatica", "", 1, date)
if err != nil {
t.Fatalf("Error while getting timetable: %s", err)
}
Expand Down
4 changes: 3 additions & 1 deletion model/responses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package model
import (
"reflect"
"testing"

tgbotapi "github.com/musianisamuele/telegram-bot-api"
)

func TestCommandResponse_IsEmpty(t *testing.T) {
Expand Down Expand Up @@ -161,7 +163,7 @@ func Test_makeResponse(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := makeResponse(tt.args.text, tt.args.nextCommand); !reflect.DeepEqual(got, tt.want) {

Check failure on line 165 in model/responses_test.go

View workflow job for this annotation

GitHub Actions / build

not enough arguments in call to makeResponse
t.Errorf("makeResponse() = %v, want %v", got, tt.want)
t.Errorf("makeResponse() = %v, want %v", got, tgbotapi.InlineKeyboardMarkup{})
}
})
}
Expand Down

0 comments on commit 1e14b20

Please sign in to comment.