mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
35 lines
794 B
Go
35 lines
794 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package api4
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGraphQLPayload(t *testing.T) {
|
|
os.Setenv("MM_FEATUREFLAGS_GRAPHQL", "true")
|
|
defer os.Unsetenv("MM_FEATUREFLAGS_GRAPHQL")
|
|
|
|
th := Setup(t).InitBasic()
|
|
defer th.TearDown()
|
|
|
|
largeString := strings.Repeat("hello", 204800)
|
|
|
|
input := graphQLInput{
|
|
OperationName: "config",
|
|
Query: largeString,
|
|
}
|
|
|
|
resp, err := th.MakeGraphQLRequest(&input)
|
|
require.NoError(t, err)
|
|
require.Len(t, resp.Errors, 1)
|
|
// The actual error isn't exposed. We compare the string
|
|
// to not confuse with other errors.
|
|
require.Contains(t, resp.Errors[0].Message, "request body too large")
|
|
}
|