(t *testing.T, ctx context.Context, s *UsersStore)
| 958 | } |
| 959 | |
| 960 | func usersListFollowings(t *testing.T, ctx context.Context, s *UsersStore) { |
| 961 | john, err := s.Create(ctx, "john", "john@example.com", CreateUserOptions{}) |
| 962 | require.NoError(t, err) |
| 963 | |
| 964 | got, err := s.ListFollowers(ctx, john.ID, 1, 1) |
| 965 | require.NoError(t, err) |
| 966 | assert.Empty(t, got) |
| 967 | |
| 968 | alice, err := s.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) |
| 969 | require.NoError(t, err) |
| 970 | bob, err := s.Create(ctx, "bob", "bob@example.com", CreateUserOptions{}) |
| 971 | require.NoError(t, err) |
| 972 | |
| 973 | err = s.Follow(ctx, john.ID, alice.ID) |
| 974 | require.NoError(t, err) |
| 975 | err = s.Follow(ctx, john.ID, bob.ID) |
| 976 | require.NoError(t, err) |
| 977 | |
| 978 | // First page only has bob |
| 979 | got, err = s.ListFollowings(ctx, john.ID, 1, 1) |
| 980 | require.NoError(t, err) |
| 981 | require.Len(t, got, 1) |
| 982 | assert.Equal(t, bob.ID, got[0].ID) |
| 983 | |
| 984 | // Second page only has alice |
| 985 | got, err = s.ListFollowings(ctx, john.ID, 2, 1) |
| 986 | require.NoError(t, err) |
| 987 | require.Len(t, got, 1) |
| 988 | assert.Equal(t, alice.ID, got[0].ID) |
| 989 | } |
| 990 | |
| 991 | func usersSearchByName(t *testing.T, ctx context.Context, s *UsersStore) { |
| 992 | alice, err := s.Create(ctx, "alice", "alice@example.com", CreateUserOptions{FullName: "Alice Jordan"}) |
nothing calls this directly
no test coverage detected