// Copyright 2026 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package stack import ( "context" "testing" "gitea.dev/tea/modules/config" "github.com/stretchr/testify/assert" ) func TestStackMergeRequiresStackID(t *testing.T) { config.SetConfigForTesting(config.LocalConfig{ Logins: []config.Login{{ Name: "testLogin", URL: "https://gitea.example.com", Token: "test-token", User: "testUser", Default: true, }}, }) t.Cleanup(func() { config.SetConfigForTesting(config.LocalConfig{}) }) cmd := CmdStackMerge err := cmd.Run(context.Background(), []string{"merge", "--login", "testLogin", "--repo", "user/repo"}) assert.ErrorContains(t, err, "stack id is required") }