Skip to content

Forks repository list page follow other repositories page #34784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/integration/repo_fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) {
req := NewRequest(t, "GET", "/user2/repo1/forks")
resp := MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
assert.Equal(t, 0, htmlDoc.Find(forkItemSelector).Length())
// current repository will also use class "flex-item" so we need to subtract 1
assert.Equal(t, 0, htmlDoc.Find(forkItemSelector).Length()-1)
})

t.Run("Logged in", func(t *testing.T) {
Expand All @@ -122,11 +123,13 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) {
resp := user1Sess.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
// since user1 is an admin, he can get both of the forked repositories
assert.Equal(t, 2, htmlDoc.Find(forkItemSelector).Length())
// current repository will also use class "flex-item" so we need to subtract 1
assert.Equal(t, 2, htmlDoc.Find(forkItemSelector).Length()-1)

assert.NoError(t, org_service.AddTeamMember(db.DefaultContext, ownerTeam2, user1))
resp = user1Sess.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
assert.Equal(t, 2, htmlDoc.Find(forkItemSelector).Length())
// current repository will also use class "flex-item" so we need to subtract 1
assert.Equal(t, 2, htmlDoc.Find(forkItemSelector).Length()-1)
})
}