mattermost-community-enterp.../cmd/mmctl/commands/webhook_e2e_test.go
Claude ec1f89217a Merge: Complete Mattermost Server with Community Enterprise
Full Mattermost server source with integrated Community Enterprise features.
Includes vendor directory for offline/air-gapped builds.

Structure:
- enterprise-impl/: Enterprise feature implementations
- enterprise-community/: Init files that register implementations
- enterprise/: Bridge imports (community_imports.go)
- vendor/: All dependencies for offline builds

Build (online):
  go build ./cmd/mattermost

Build (offline/air-gapped):
  go build -mod=vendor ./cmd/mattermost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:59:07 +09:00

40 lines
1.3 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package commands
import (
"github.com/spf13/cobra"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/printer"
"github.com/mattermost/mattermost/server/public/model"
)
func (s *MmctlE2ETestSuite) TestCreateIncomingWebhookCmd() {
s.SetupTestHelper().InitBasic()
s.Run("provided values should be consistent with the created webhook", func() {
printer.Clean()
cmd := &cobra.Command{}
cmd.Flags().String("channel", s.th.BasicChannel.Id, "")
cmd.Flags().String("user", s.th.BasicUser2.Username, "")
cmd.Flags().String("display-name", "webhook-test-1", "")
cmd.Flags().String("description", "webhook-test-1-desc", "")
cmd.Flags().Bool("lock-to-channel", true, "")
err := createIncomingWebhookCmdF(s.th.SystemAdminClient, cmd, nil)
s.Require().Nil(err)
s.Require().Len(printer.GetLines(), 1)
s.Require().Len(printer.GetErrorLines(), 0)
hook := printer.GetLines()[0].(*model.IncomingWebhook)
s.Require().Equal(s.th.BasicUser2.Id, hook.UserId)
s.Require().Equal(s.th.BasicChannel.Id, hook.ChannelId)
s.Require().Equal("webhook-test-1", hook.DisplayName)
s.Require().Equal("webhook-test-1-desc", hook.Description)
s.Require().True(hook.ChannelLocked)
})
}