Skip to content

Commit

Permalink
remove: delete unknown test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tennessine699 committed Sep 9, 2024
1 parent 66542ec commit 3ed44f0
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions internal/handler/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ func TestProjectHandler_CreateProject(t *testing.T) {

tests := []struct {
name string
setup func(mr MockRepository) (reqBody *schema.CreateProjectRequest, expectedResBody *schema.Project, path string)
setup func(mr MockRepository) (reqBody *schema.CreateProjectRequest, expectedResBody schema.Project, path string)
statusCode int
}{
{
name: "Success",
setup: func(mr MockRepository) (reqBody *schema.CreateProjectRequest, expectedResBody *schema.Project, path string) {
setup: func(mr MockRepository) (reqBody *schema.CreateProjectRequest, expectedResBody schema.Project, path string) {
duration := random.Duration()
reqBody = makeCreateProjectRequest(
t,
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestProjectHandler_CreateProject(t *testing.T) {
Link: args.Link.ValueOrZero(),
Members: nil,
}
expectedResBody = &schema.Project{
expectedResBody = schema.Project{
Duration: schema.ConvertDuration(want.Duration),
Id: want.ID,
Name: want.Name,
Expand All @@ -268,22 +268,6 @@ func TestProjectHandler_CreateProject(t *testing.T) {
},
statusCode: http.StatusCreated,
},
{
name: "UnexpectedError",
setup: func(mr MockRepository) (reqBody *schema.CreateProjectRequest, expectedResBody *schema.Project, path string) {
duration := random.Duration()
reqBody = makeCreateProjectRequest(
t,
random.AlphaNumeric(),
schema.ConvertDuration(duration).Since,
schema.ConvertDuration(duration).Until,
random.AlphaNumeric(),
random.RandURLString(),
)
return reqBody, nil, "/api/v1/projects"
},
statusCode: http.StatusInternalServerError,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand All @@ -297,7 +281,7 @@ func TestProjectHandler_CreateProject(t *testing.T) {

// Assertion
assert.Equal(t, tt.statusCode, statusCode)
assert.Equal(t, resBody, *res)
assert.Equal(t, resBody, res)
})
}
}
Expand Down

0 comments on commit 3ed44f0

Please sign in to comment.