Skip to content

Commit

Permalink
fix: tried to fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Nov 18, 2023
1 parent 6ed52db commit 0005e0d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions controllers/mentor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,21 @@ func TestMentorDashboardOK(t *testing.T) {
}

pulls := make([]string, 0)
if len(p.Pulls) > 0 {
pulls = strings.Split(p.Pulls, ",")
}

tags := make([]string, 0)
if len(p.Tags) > 0 {
tags = strings.Split(p.Tags, ",")
}

projects = append(projects, controllers.ProjectInfo{
Name: p.Name,
Description: p.Description,
RepoLink: p.RepoLink,
ReadmeLink: p.ReadmeLink,
Tags: tags,
ProjectStatus: p.ProjectStatus,

CommitCount: p.CommitCount,
Expand All @@ -333,6 +344,14 @@ func TestMentorDashboardOK(t *testing.T) {
LinesRemoved: p.LinesRemoved,

Pulls: pulls,
Mentor: controllers.Mentor{
Username: p.Mentor.Username,
Name: p.Mentor.Name,
},
SecondaryMentor: controllers.Mentor{
Username: p.SecondaryMentor.Username,
Name: p.SecondaryMentor.Name,
},
})
}

Expand Down Expand Up @@ -367,6 +386,8 @@ func TestMentorDashboardOK(t *testing.T) {
var resMentor controllers.MentorDashboard
_ = json.NewDecoder(res.Body).Decode(&resMentor)

fmt.Printf("%+v %+v", testMentor, resMentor)

expectStatusCodeToBe(t, res, http.StatusOK)
if !reflect.DeepEqual(testMentor, resMentor) {
t.Fatalf("Incorrect data returned from /mentor/dashboard/")
Expand Down

0 comments on commit 0005e0d

Please sign in to comment.