Skip to content

Commit 65c2dd0

Browse files
committed
Modify for unit test
1 parent 52e5f01 commit 65c2dd0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

modules/indexer/issues/indexer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func searchIssueInProject(t *testing.T) {
365365
SearchOptions{
366366
ProjectIDs: []int64{1},
367367
},
368-
[]int64{5, 3, 2, 1},
368+
[]int64{2},
369369
},
370370
{
371371
SearchOptions{

modules/indexer/issues/internal/tests/tests.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,30 +302,30 @@ var cases = []*testIndexerCase{
302302
},
303303
},
304304
{
305-
Name: "ProjectID",
305+
Name: "ProjectIDs",
306306
SearchOptions: &internal.SearchOptions{
307307
Paginator: &db.ListOptions{
308308
PageSize: 5,
309309
},
310-
ProjectIDs: optional.Some(int64(1)),
310+
ProjectIDs: []int64{1},
311311
},
312312
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) {
313313
assert.Equal(t, 5, len(result.Hits))
314314
for _, v := range result.Hits {
315-
assert.Contains(t, data[v.ID].ProjectIDs, int64(1))
315+
assert.Contains(t, []int64{1}, data[v.ID].ProjectIDs)
316316
}
317317
assert.Equal(t, countIndexerData(data, func(v *internal.IndexerData) bool {
318318
return slices.Contains(v.ProjectIDs, 1)
319319
}), result.Total)
320320
},
321321
},
322322
{
323-
Name: "no ProjectID",
323+
Name: "no ProjectIDs",
324324
SearchOptions: &internal.SearchOptions{
325325
Paginator: &db.ListOptions{
326326
PageSize: 5,
327327
},
328-
ProjectIDs: optional.Some(int64(0)),
328+
ProjectIDs: []int64{0},
329329
},
330330
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) {
331331
assert.Equal(t, 5, len(result.Hits))

0 commit comments

Comments
 (0)