Provide a channel header menu action and /cleanup-channel slash command so system administrators can remove all messages from a channel, with admin checks enforced on both the web app and server. Configure CI and release workflows for the Forgejo runner and signed plugin bundles. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
No EOL
525 B
Go
23 lines
No EOL
525 B
Go
package command
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestHandleUnknownCommand(t *testing.T) {
|
|
handler := &Handler{
|
|
cleanup: func(userID, channelID string) (int, error) {
|
|
return 0, nil
|
|
},
|
|
}
|
|
|
|
response, err := handler.Handle(&model.CommandArgs{
|
|
Command: "/unknown",
|
|
})
|
|
require.NoError(t, err)
|
|
require.Equal(t, model.CommandResponseTypeEphemeral, response.ResponseType)
|
|
require.Contains(t, response.Text, "Unknown command")
|
|
} |