MM-15276: Migrate Team.Update to sync by default (#10693)

* MM-15276: Migrate Team.Update to sync by default

* MM-15276: Addressing review comments and change Update func signature similar to other interface Update method

* update store mocks for update fn

* addressing review comments
This commit is contained in:
Puneeth Reddy
2019-04-25 06:29:02 -07:00
committed by Jesús Espino
parent b24013d54c
commit ec95793b90
17 changed files with 109 additions and 111 deletions

View File

@@ -181,14 +181,12 @@ func TestPostSanitizeProps(t *testing.T) {
}
func TestPost_AttachmentsEqual(t *testing.T) {
post1 := &Post {
}
post2 := &Post {
}
post1 := &Post{}
post2 := &Post{}
for name, tc := range map[string]struct {
Attachments1 []*SlackAttachment
Attachments2 []*SlackAttachment
Expected bool
Expected bool
}{
"Empty": {
nil,
@@ -233,7 +231,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
"DifferentColor": {
[]*SlackAttachment{
{
Text: "Hello World",
Text: "Hello World",
Color: "#152313",
},
},
@@ -247,7 +245,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
"EqualFields": {
[]*SlackAttachment{
{
Fields: []*SlackAttachmentField {
Fields: []*SlackAttachmentField{
{
Title: "Hello World",
Value: "FooBar",
@@ -261,7 +259,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
},
[]*SlackAttachment{
{
Fields: []*SlackAttachmentField {
Fields: []*SlackAttachmentField{
{
Title: "Hello World",
Value: "FooBar",
@@ -278,7 +276,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
"DifferentFields": {
[]*SlackAttachment{
{
Fields: []*SlackAttachmentField {
Fields: []*SlackAttachmentField{
{
Title: "Hello World",
Value: "FooBar",
@@ -288,7 +286,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
},
[]*SlackAttachment{
{
Fields: []*SlackAttachmentField {
Fields: []*SlackAttachmentField{
{
Title: "Hello World",
Value: "FooBar",
@@ -310,9 +308,9 @@ func TestPost_AttachmentsEqual(t *testing.T) {
Actions: []*PostAction{
{
Name: "FooBar",
Options: []*PostActionOptions {
Options: []*PostActionOptions{
{
Text: "abcdef",
Text: "abcdef",
Value: "abcdef",
},
},
@@ -320,7 +318,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
URL: "http://localhost",
Context: map[string]interface{}{
"context": "foobar",
"test": 123,
"test": 123,
},
},
},
@@ -332,9 +330,9 @@ func TestPost_AttachmentsEqual(t *testing.T) {
Actions: []*PostAction{
{
Name: "FooBar",
Options: []*PostActionOptions {
Options: []*PostActionOptions{
{
Text: "abcdef",
Text: "abcdef",
Value: "abcdef",
},
},
@@ -342,7 +340,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
URL: "http://localhost",
Context: map[string]interface{}{
"context": "foobar",
"test": 123,
"test": 123,
},
},
},
@@ -357,9 +355,9 @@ func TestPost_AttachmentsEqual(t *testing.T) {
Actions: []*PostAction{
{
Name: "FooBar",
Options: []*PostActionOptions {
Options: []*PostActionOptions{
{
Text: "abcdef",
Text: "abcdef",
Value: "abcdef",
},
},
@@ -367,7 +365,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
URL: "http://localhost",
Context: map[string]interface{}{
"context": "foobar",
"test": "mattermost",
"test": "mattermost",
},
},
},
@@ -379,9 +377,9 @@ func TestPost_AttachmentsEqual(t *testing.T) {
Actions: []*PostAction{
{
Name: "FooBar",
Options: []*PostActionOptions {
Options: []*PostActionOptions{
{
Text: "abcdef",
Text: "abcdef",
Value: "abcdef",
},
},
@@ -389,7 +387,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
URL: "http://localhost",
Context: map[string]interface{}{
"context": "foobar",
"test": 123,
"test": 123,
},
},
},

View File

@@ -252,8 +252,8 @@ var hashtags = map[string]string{
func TestStringArray_Equal(t *testing.T) {
for name, tc := range map[string]struct {
Array1 StringArray
Array2 StringArray
Array1 StringArray
Array2 StringArray
Expected bool
}{
"Empty": {