mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-19 13:39:26 +00:00
Some checks failed
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
Integration tests for the release process / release-simulation (push) Has been cancelled
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package integration
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
"testing"
|
|
|
|
"forgejo.org/tests"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// TestRepoCollaborators is a test for contents of Collaborators tab in the repo settings
|
|
// It only covers a few elements and can be extended as needed
|
|
func TestRepoCollaborators(t *testing.T) {
|
|
defer tests.PrepareTestEnv(t)()
|
|
session := loginUser(t, "user2")
|
|
|
|
// Visit Collaborators tab of repo settings
|
|
response := session.MakeRequest(t, NewRequest(t, "GET", "/user2/repo1/settings/collaboration"), http.StatusOK)
|
|
page := NewHTMLParser(t, response.Body).Find(".repo-setting-content")
|
|
|
|
// Veirfy header
|
|
assert.Equal(t, "Collaborators", strings.TrimSpace(page.Find("h4").Text()))
|
|
|
|
// Veirfy button text
|
|
page = page.Find("#repo-collab-form")
|
|
assert.Equal(t, "Add collaborator", strings.TrimSpace(page.Find("button.primary").Text()))
|
|
|
|
// Veirfy placeholder
|
|
placeholder, exists := page.Find("#search-user-box input").Attr("placeholder")
|
|
assert.True(t, exists)
|
|
assert.Equal(t, "Search users…", placeholder)
|
|
}
|