Mono repo -> Master (#22553)
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
Этот коммит содержится в:
26
server/channels/app/users/profile_picture_test.go
Обычный файл
26
server/channels/app/users/profile_picture_test.go
Обычный файл
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package users
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"image"
|
||||
"image/color"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCreateProfileImage(t *testing.T) {
|
||||
b, err := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba", "nunito-bold.ttf")
|
||||
require.NoError(t, err)
|
||||
|
||||
rdr := bytes.NewReader(b)
|
||||
img, _, err2 := image.Decode(rdr)
|
||||
require.NoError(t, err2)
|
||||
|
||||
colorful := color.RGBA{116, 49, 196, 255}
|
||||
|
||||
require.Equal(t, colorful, img.At(1, 1), "Failed to create correct color")
|
||||
}
|
||||
Ссылка в новой задаче
Block a user