Skip to content

Commit e1165ce

Browse files
committed
test: add test where not covered
1 parent 8775402 commit e1165ce

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

integrationtest/repo_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
397397

398398
uploadObject(ctx, c, client, "add sec object", userName, repoName, controller.DefaultBranchName, "b.txt")
399399
commitWip(ctx, c, client, "commit sec object", userName, repoName, controller.DefaultBranchName, "second commit")
400+
uploadObject(ctx, c, client, "add third object", userName, repoName, controller.DefaultBranchName, "c.txt")
401+
commitWip(ctx, c, client, "commit third object", userName, repoName, controller.DefaultBranchName, "third commit")
400402
c.Convey("success get commits by params", func() {
401403
resp, err := client.GetCommitsInRepository(ctx, userName, repoName, &api.GetCommitsInRepositoryParams{
402404
RefName: utils.String(controller.DefaultBranchName),
@@ -406,8 +408,8 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
406408

407409
result, err := api.ParseGetCommitsInRepositoryResponse(resp)
408410
convey.So(err, convey.ShouldBeNil)
409-
convey.So(*result.JSON200, convey.ShouldHaveLength, 2)
410-
convey.So((*result.JSON200)[0].Message, convey.ShouldEqual, "second commit")
411+
convey.So(*result.JSON200, convey.ShouldHaveLength, 3)
412+
convey.So((*result.JSON200)[0].Message, convey.ShouldEqual, "third commit")
411413

412414
newResp, err := client.GetCommitsInRepository(ctx, userName, repoName, &api.GetCommitsInRepositoryParams{
413415
After: utils.Time((*result.JSON200)[0].CreatedAt),
@@ -420,7 +422,7 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
420422
newResult, err := api.ParseGetCommitsInRepositoryResponse(newResp)
421423
convey.So(err, convey.ShouldBeNil)
422424
convey.So(*newResult.JSON200, convey.ShouldHaveLength, 1)
423-
convey.So((*newResult.JSON200)[0].Message, convey.ShouldEqual, "first commit")
425+
convey.So((*newResult.JSON200)[0].Message, convey.ShouldEqual, "second commit")
424426
})
425427
})
426428

integrationtest/root_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ func TestSpec(t *testing.T) {
1414

1515
convey.Convey("user test", t, UserSpec(ctx, urlStr))
1616
convey.Convey("repo test", t, RepoSpec(ctx, urlStr))
17-
// convey.Convey("branch test", t, BranchSpec(ctx, urlStr))
18-
// convey.Convey("wip test", t, WipSpec(ctx, urlStr))
19-
// convey.Convey("object test", t, ObjectSpec(ctx, urlStr))
20-
// convey.Convey("wip object test", t, WipObjectSpec(ctx, urlStr))
21-
// convey.Convey("commit test", t, GetEntriesInRefSpec(ctx, urlStr))
17+
convey.Convey("branch test", t, BranchSpec(ctx, urlStr))
18+
convey.Convey("wip test", t, WipSpec(ctx, urlStr))
19+
convey.Convey("object test", t, ObjectSpec(ctx, urlStr))
20+
convey.Convey("wip object test", t, WipObjectSpec(ctx, urlStr))
21+
convey.Convey("commit test", t, GetEntriesInRefSpec(ctx, urlStr))
2222
}

0 commit comments

Comments
 (0)