Этот коммит содержится в:
Ben Schumacher
2019-10-28 14:08:08 +01:00
коммит произвёл Lev
родитель 8a72ed2833
Коммит e61340c54e
23 изменённых файлов: 141 добавлений и 141 удалений

Просмотреть файл

@@ -17,9 +17,9 @@ func TestClient4CreatePost(t *testing.T) {
post := &Post{
Props: map[string]interface{}{
"attachments": []*SlackAttachment{
&SlackAttachment{
{
Actions: []*PostAction{
&PostAction{
{
Integration: &PostActionIntegration{
Context: map[string]interface{}{
"foo": "bar",
@@ -37,9 +37,9 @@ func TestClient4CreatePost(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
attachments := PostFromJson(r.Body).Attachments()
assert.Equal(t, []*SlackAttachment{
&SlackAttachment{
{
Actions: []*PostAction{
&PostAction{
{
Integration: &PostActionIntegration{
Context: map[string]interface{}{
"foo": "bar",

Просмотреть файл

@@ -146,7 +146,7 @@ func TestCommandResponseFromJson(t *testing.T) {
&CommandResponse{
Text: "message 1",
ExtraResponses: []*CommandResponse{
&CommandResponse{
{
Text: "message 2",
},
},
@@ -180,7 +180,7 @@ func TestCommandResponseFromJson(t *testing.T) {
},
},
ExtraResponses: []*CommandResponse{
&CommandResponse{
{
Text: "message 2",
Attachments: []*SlackAttachment{
{

Просмотреть файл

@@ -305,8 +305,8 @@ func TestTruncateOpenGraph(t *testing.T) {
sampleImage("metoo.gif"),
sampleImage("fifth.ico"),
sampleImage("notme.tiff")},
Audios: []*opengraph.Audio{&opengraph.Audio{}},
Videos: []*opengraph.Video{&opengraph.Video{}},
Audios: []*opengraph.Audio{{}},
Videos: []*opengraph.Video{{}},
Article: &opengraph.Article{},
Book: &opengraph.Book{},
Profile: &opengraph.Profile{},

Просмотреть файл

@@ -83,7 +83,7 @@ func TestManifestUnmarshal(t *testing.T) {
Header: "theheadertext",
Footer: "thefootertext",
Settings: []*PluginSetting{
&PluginSetting{
{
Key: "thesetting",
DisplayName: "thedisplayname",
Type: "dropdown",
@@ -91,7 +91,7 @@ func TestManifestUnmarshal(t *testing.T) {
RegenerateHelpText: "theregeneratehelptext",
Placeholder: "theplaceholder",
Options: []*PluginOption{
&PluginOption{
{
DisplayName: "theoptiondisplayname",
Value: "thevalue",
},
@@ -232,7 +232,7 @@ func TestManifestJson(t *testing.T) {
Header: "theheadertext",
Footer: "thefootertext",
Settings: []*PluginSetting{
&PluginSetting{
{
Key: "thesetting",
DisplayName: "thedisplayname",
Type: "dropdown",
@@ -240,7 +240,7 @@ func TestManifestJson(t *testing.T) {
RegenerateHelpText: "theregeneratehelptext",
Placeholder: "theplaceholder",
Options: []*PluginOption{
&PluginOption{
{
DisplayName: "theoptiondisplayname",
Value: "thevalue",
},
@@ -299,7 +299,7 @@ func TestManifestClientManifest(t *testing.T) {
Header: "theheadertext",
Footer: "thefootertext",
Settings: []*PluginSetting{
&PluginSetting{
{
Key: "thesetting",
DisplayName: "thedisplayname",
Type: "dropdown",
@@ -307,7 +307,7 @@ func TestManifestClientManifest(t *testing.T) {
RegenerateHelpText: "theregeneratehelptext",
Placeholder: "theplaceholder",
Options: []*PluginOption{
&PluginOption{
{
DisplayName: "theoptiondisplayname",
Value: "thevalue",
},

Просмотреть файл

@@ -8,8 +8,8 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestSessionDeepCopy(t *testing.T) {
@@ -18,7 +18,7 @@ func TestSessionDeepCopy(t *testing.T) {
mapKey := "key"
mapValue := "val"
session := &Session{Id: sessionId, Props: map[string]string{mapKey: mapValue}, TeamMembers: []*TeamMember{&TeamMember{UserId: userId, TeamId: "someteamId"}}}
session := &Session{Id: sessionId, Props: map[string]string{mapKey: mapValue}, TeamMembers: []*TeamMember{{UserId: userId, TeamId: "someteamId"}}}
copySession := session.DeepCopy()
copySession.Id = "changed"

Просмотреть файл

@@ -63,7 +63,7 @@ func TestUserPreSave(t *testing.T) {
user.PreSave()
user.Etag(true, true)
assert.NotNil(t, user.Timezone, "Timezone is nil")
assert.Equal(t, user.Timezone["useAutomaticTimezone"], "true", "Timezone is not set to default");
assert.Equal(t, user.Timezone["useAutomaticTimezone"], "true", "Timezone is not set to default")
}
func TestUserPreUpdate(t *testing.T) {