fix(labels): add org label for ls and pr (#1017)

Fix https://gitea.com/gitea/tea/issues/634, https://gitea.com/gitea/tea/issues/669

Reviewed-on: https://gitea.com/gitea/tea/pulls/1017
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Minjie Fang <wingsallen@gmail.com>
Co-committed-by: Minjie Fang <wingsallen@gmail.com>
This commit is contained in:
Minjie Fang
2026-06-24 17:46:12 +00:00
committed by Lunny Xiao
parent 5cfee362c8
commit 88f5cdcafa
8 changed files with 371 additions and 13 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ import (
"testing"
"time"
"gitea.dev/sdk"
gitea "gitea.dev/sdk"
teacmd "gitea.dev/tea/cmd"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -25,10 +25,10 @@ func TestWikiCommandLifecycle(t *testing.T) {
client := login.Client()
repoName := fmt.Sprintf("tea-wiki-integration-%d", time.Now().UnixNano())
_, _, err := client.CreateRepo(context.Background(), gitea.CreateRepoOption{Name: repoName})
_, _, err := client.Repositories.CreateRepo(context.Background(), gitea.CreateRepoOption{Name: repoName})
require.NoError(t, err)
t.Cleanup(func() {
if _, delErr := client.DeleteRepo(context.Background(), login.User, repoName); delErr != nil {
if _, delErr := client.Repositories.DeleteRepo(context.Background(), login.User, repoName); delErr != nil {
t.Logf("failed to delete integration test repo %q: %v", repoName, delErr)
}
})
@@ -60,10 +60,10 @@ func TestWikiCommandLifecycle(t *testing.T) {
assert.Contains(t, listOutput, "\"title\": \"Home\"")
emptyRepoName := fmt.Sprintf("tea-wiki-empty-%d", time.Now().UnixNano())
_, _, err = client.CreateRepo(context.Background(), gitea.CreateRepoOption{Name: emptyRepoName})
_, _, err = client.Repositories.CreateRepo(context.Background(), gitea.CreateRepoOption{Name: emptyRepoName})
require.NoError(t, err)
t.Cleanup(func() {
if _, delErr := client.DeleteRepo(context.Background(), login.User, emptyRepoName); delErr != nil {
if _, delErr := client.Repositories.DeleteRepo(context.Background(), login.User, emptyRepoName); delErr != nil {
t.Logf("failed to delete empty wiki repo %q: %v", emptyRepoName, delErr)
}
})