Skip to content

Commit 0c655c4

Browse files
committed
add testcase for fix
1 parent 1a378f4 commit 0c655c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

models/user/search_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ func TestBuildCanSeeUserCondition(t *testing.T) {
5858
assert.Len(t, ids, 28)
5959
assert.EqualValues(t, []int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 27, 28, 29, 30, 31, 32, 33, 34, 36}, ids)
6060

61+
// limited user who is followed by private user
62+
cond = user.BuildCanSeeUserCondition(getUser(t, 33))
63+
ids = getIDs(cond)
64+
assert.Len(t, ids, 28)
65+
assert.EqualValues(t, []int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 27, 28, 29, 30, 31, 32, 33, 34, 36}, ids)
66+
6167
// restricted user
6268
cond = user.BuildCanSeeUserCondition(getUser(t, 29))
6369
ids = getIDs(cond)

0 commit comments

Comments
 (0)