spelling: strings (#19542)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -88,15 +88,15 @@ func TestRemoveAllDeactivatedMembersFromChannel(t *testing.T) {
|
||||
_, _, err = th.App.AddUserToTeam(th.Context, team.Id, th.BasicUser.Id, "")
|
||||
require.Nil(t, err)
|
||||
|
||||
deacivatedUser := th.CreateUser()
|
||||
_, _, err = th.App.AddUserToTeam(th.Context, team.Id, deacivatedUser.Id, "")
|
||||
deactivatedUser := th.CreateUser()
|
||||
_, _, err = th.App.AddUserToTeam(th.Context, team.Id, deactivatedUser.Id, "")
|
||||
require.Nil(t, err)
|
||||
_, err = th.App.AddUserToChannel(deacivatedUser, channel, false)
|
||||
_, err = th.App.AddUserToChannel(deactivatedUser, channel, false)
|
||||
require.Nil(t, err)
|
||||
channelMembers, err := th.App.GetChannelMembersPage(channel.Id, 0, 10000000)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, channelMembers, 2)
|
||||
_, err = th.App.UpdateActive(th.Context, deacivatedUser, false)
|
||||
_, err = th.App.UpdateActive(th.Context, deactivatedUser, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
err = th.App.RemoveAllDeactivatedMembersFromChannel(channel)
|
||||
@@ -148,23 +148,23 @@ func TestMoveChannel(t *testing.T) {
|
||||
|
||||
// Test moving a channel with a deactivated user who isn't in the destination team.
|
||||
// It should fail, unless removeDeactivatedMembers is true.
|
||||
deacivatedUser := th.CreateUser()
|
||||
deactivatedUser := th.CreateUser()
|
||||
channel2 := th.CreateChannel(sourceTeam)
|
||||
defer th.App.PermanentDeleteChannel(channel2)
|
||||
|
||||
_, _, err = th.App.AddUserToTeam(th.Context, sourceTeam.Id, deacivatedUser.Id, "")
|
||||
_, _, err = th.App.AddUserToTeam(th.Context, sourceTeam.Id, deactivatedUser.Id, "")
|
||||
require.Nil(t, err)
|
||||
_, err = th.App.AddUserToChannel(th.BasicUser, channel2, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.AddUserToChannel(deacivatedUser, channel2, false)
|
||||
_, err = th.App.AddUserToChannel(deactivatedUser, channel2, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.UpdateActive(th.Context, deacivatedUser, false)
|
||||
_, err = th.App.UpdateActive(th.Context, deactivatedUser, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
err = th.App.MoveChannel(th.Context, targetTeam, channel2, th.BasicUser)
|
||||
require.NotNil(t, err, "Should have failed due to mismatched deacivated member.")
|
||||
require.NotNil(t, err, "Should have failed due to mismatched deactivated member.")
|
||||
|
||||
// Test moving a channel with no members.
|
||||
channel3 := &model.Channel{
|
||||
@@ -1821,9 +1821,9 @@ func TestPatchChannelModerationsForChannel(t *testing.T) {
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.Name, func(t *testing.T) {
|
||||
higherScopedPermissionsOverriden := tc.HigherScopedMemberPermissions != nil || tc.HigherScopedGuestPermissions != nil
|
||||
higherScopedPermissionsOverridden := tc.HigherScopedMemberPermissions != nil || tc.HigherScopedGuestPermissions != nil
|
||||
// If the test case restricts higher scoped permissions.
|
||||
if higherScopedPermissionsOverriden {
|
||||
if higherScopedPermissionsOverridden {
|
||||
higherScopedGuestRoleName, higherScopedMemberRoleName, _, _ := th.App.GetTeamSchemeChannelRoles(channel.TeamId)
|
||||
if tc.HigherScopedMemberPermissions != nil {
|
||||
higherScopedMemberRole, err := th.App.GetRoleByName(context.Background(), higherScopedMemberRoleName)
|
||||
|
||||
@@ -331,11 +331,11 @@ func TestGenerateThumbnailImage(t *testing.T) {
|
||||
defer th.TearDown()
|
||||
img := createDummyImage()
|
||||
dataPath, _ := fileutils.FindDir("data")
|
||||
thumbailName := "thumb.jpg"
|
||||
thumbnailPath := filepath.Join(dataPath, thumbailName)
|
||||
thumbnailName := "thumb.jpg"
|
||||
thumbnailPath := filepath.Join(dataPath, thumbnailName)
|
||||
|
||||
// when
|
||||
th.App.generateThumbnailImage(img, thumbailName)
|
||||
th.App.generateThumbnailImage(img, thumbnailName)
|
||||
defer os.Remove(thumbnailPath)
|
||||
|
||||
// then
|
||||
|
||||
@@ -615,7 +615,7 @@ func TestImportImportChannel(t *testing.T) {
|
||||
Team: &teamName,
|
||||
DisplayName: ptrStr("Display Name"),
|
||||
Type: &chanOpen,
|
||||
Header: ptrStr("Channe Header"),
|
||||
Header: ptrStr("Channel Header"),
|
||||
Purpose: ptrStr("Channel Purpose"),
|
||||
Scheme: &scheme1.Name,
|
||||
}
|
||||
@@ -680,7 +680,7 @@ func TestImportImportChannel(t *testing.T) {
|
||||
|
||||
// Alter all the fields of that channel.
|
||||
cTypePr := model.ChannelTypePrivate
|
||||
data.DisplayName = ptrStr("Chaned Disp Name")
|
||||
data.DisplayName = ptrStr("Changed Disp Name")
|
||||
data.Type = &cTypePr
|
||||
data.Header = ptrStr("New Header")
|
||||
data.Purpose = ptrStr("New Purpose")
|
||||
@@ -1400,7 +1400,7 @@ func TestImportImportUser(t *testing.T) {
|
||||
Name: ptrStr(model.NewId()),
|
||||
DisplayName: ptrStr("Display Name"),
|
||||
Type: &chanTypeOpen,
|
||||
Header: ptrStr("Channe Header"),
|
||||
Header: ptrStr("Channel Header"),
|
||||
Purpose: ptrStr("Channel Purpose"),
|
||||
}
|
||||
appErr = th.App.importChannel(th.Context, channelData, false)
|
||||
|
||||
@@ -1458,7 +1458,7 @@ func TestGetMentionKeywords(t *testing.T) {
|
||||
|
||||
profiles = map[string]*model.User{userNoMentionKeys.Id: userNoMentionKeys}
|
||||
mentions = th.App.getMentionKeywordsInChannel(profiles, true, channelMemberNotifyPropsMapEmptyOff)
|
||||
assert.Equal(t, 1, len(mentions), "should've returned one metion keyword")
|
||||
assert.Equal(t, 1, len(mentions), "should've returned one mention keyword")
|
||||
ids, ok = mentions["@user"]
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, userNoMentionKeys.Id, ids[0], "should've returned mention key of @user")
|
||||
@@ -2320,7 +2320,7 @@ func TestProcessText(t *testing.T) {
|
||||
ChannelMentioned: true,
|
||||
},
|
||||
},
|
||||
"Mention other pontential users or system calls": {
|
||||
"Mention other potential users or system calls": {
|
||||
Text: "hello @potentialuser and @otherpotentialuser",
|
||||
Keywords: map[string][]string{},
|
||||
Groups: map[string]*model.Group{"engineering": {Name: model.NewString("engineering")}, "developers": {Name: model.NewString("developers")}},
|
||||
|
||||
@@ -1850,7 +1850,7 @@ func TestPluginAPISearchPostsInTeamByUser(t *testing.T) {
|
||||
api := th.SetupPluginAPI()
|
||||
|
||||
basicPostText := &th.BasicPost.Message
|
||||
unknwonTerm := "Unknown Message"
|
||||
unknownTerm := "Unknown Message"
|
||||
|
||||
testCases := []struct {
|
||||
description string
|
||||
@@ -1870,7 +1870,7 @@ func TestPluginAPISearchPostsInTeamByUser(t *testing.T) {
|
||||
"doesn't match any posts",
|
||||
th.BasicTeam.Id,
|
||||
th.BasicUser.Id,
|
||||
model.SearchParameter{Terms: &unknwonTerm},
|
||||
model.SearchParameter{Terms: &unknownTerm},
|
||||
0,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -309,7 +309,7 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
|
||||
emoji := "basketball"
|
||||
url := "http://host.com/image.png"
|
||||
overridenURL := "/static/emoji/1f3c0.png"
|
||||
overriddenURL := "/static/emoji/1f3c0.png"
|
||||
|
||||
t.Run("does not override icon URL", func(t *testing.T) {
|
||||
clientPost := prepare(false, url, emoji)
|
||||
@@ -327,7 +327,7 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
|
||||
s, ok := clientPost.GetProps()[model.PostPropsOverrideIconURL]
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, overridenURL, s)
|
||||
assert.EqualValues(t, overriddenURL, s)
|
||||
s, ok = clientPost.GetProps()[model.PostPropsOverrideIconEmoji]
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, emoji, s)
|
||||
@@ -339,7 +339,7 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
|
||||
s, ok := clientPost.GetProps()[model.PostPropsOverrideIconURL]
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, overridenURL, s)
|
||||
assert.EqualValues(t, overriddenURL, s)
|
||||
s, ok = clientPost.GetProps()[model.PostPropsOverrideIconEmoji]
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, colonEmoji, s)
|
||||
@@ -1421,7 +1421,7 @@ func TestGetFirstLinkAndImages(t *testing.T) {
|
||||
"markdown links (not returned)": {
|
||||
Input: `this is a [our page](http://example.com) and [another page][]
|
||||
|
||||
[another page]: http://www.exaple.com/another_page`,
|
||||
[another page]: http://www.example.com/another_page`,
|
||||
ExpectedFirstLink: "",
|
||||
ExpectedImages: []string{},
|
||||
},
|
||||
|
||||
@@ -544,7 +544,7 @@ func TestNoticeValidation(t *testing.T) {
|
||||
wantOk: true,
|
||||
},
|
||||
{
|
||||
name: "notice with depreacting an external dependency",
|
||||
name: "notice with deprecating an external dependency",
|
||||
args: args{
|
||||
dbmsName: "mysql",
|
||||
dbmsVer: "5.6",
|
||||
@@ -561,7 +561,7 @@ func TestNoticeValidation(t *testing.T) {
|
||||
wantOk: true,
|
||||
},
|
||||
{
|
||||
name: "notice with depreacting an external dependency, on a future version",
|
||||
name: "notice with deprecating an external dependency, on a future version",
|
||||
args: args{
|
||||
dbmsName: "mysql",
|
||||
dbmsVer: "5.6",
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestAddRemoteCluster(t *testing.T) {
|
||||
remoteCluster := &model.RemoteCluster{
|
||||
RemoteTeamId: model.NewId(),
|
||||
Name: "test2",
|
||||
SiteURL: "http://www2.exmaple.com:8065",
|
||||
SiteURL: "http://www2.example.com:8065",
|
||||
Token: model.NewId(),
|
||||
RemoteToken: model.NewId(),
|
||||
Topics: "",
|
||||
@@ -75,7 +75,7 @@ func TestUpdateRemoteCluster(t *testing.T) {
|
||||
remoteCluster := &model.RemoteCluster{
|
||||
RemoteTeamId: model.NewId(),
|
||||
Name: "test3",
|
||||
SiteURL: "http://www3.exmaple.com:8065",
|
||||
SiteURL: "http://www3.example.com:8065",
|
||||
Token: model.NewId(),
|
||||
RemoteToken: model.NewId(),
|
||||
Topics: "",
|
||||
|
||||
@@ -547,7 +547,7 @@ func TestPanicLog(t *testing.T) {
|
||||
s, err := NewServer(SetLogger(logger))
|
||||
require.NoError(t, err)
|
||||
|
||||
// Route for just panicing
|
||||
// Route for just panicking
|
||||
s.Router.HandleFunc("/panic", func(writer http.ResponseWriter, request *http.Request) {
|
||||
s.Log.Info("inside panic handler")
|
||||
panic("log this panic")
|
||||
@@ -684,7 +684,7 @@ func TestSentry(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// Route for just panicing
|
||||
// Route for just panicking
|
||||
s.Router.HandleFunc("/panic", func(writer http.ResponseWriter, request *http.Request) {
|
||||
panic("log this panic")
|
||||
})
|
||||
|
||||
@@ -766,7 +766,7 @@ func TestJoinUserToTeam(t *testing.T) {
|
||||
require.NotNil(t, appErr, "Should fail")
|
||||
})
|
||||
|
||||
t.Run("re-join alfter leaving with limit problem", func(t *testing.T) {
|
||||
t.Run("re-join after leaving with limit problem", func(t *testing.T) {
|
||||
user1 := model.User{Email: strings.ToLower(model.NewId()) + "success+test@example.com", Nickname: "Darth Vader", Username: "vader" + model.NewId(), Password: "passwd1", AuthService: ""}
|
||||
ruser1, _ := th.App.CreateUser(th.Context, &user1)
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ func TestJoinUserToTeam(t *testing.T) {
|
||||
require.Error(t, err, "Should fail")
|
||||
})
|
||||
|
||||
t.Run("re-join alfter leaving with limit problem", func(t *testing.T) {
|
||||
t.Run("re-join after leaving with limit problem", func(t *testing.T) {
|
||||
user1 := model.User{Email: strings.ToLower(model.NewId()) + "success+test@example.com", Nickname: "Darth Vader", Username: "vader" + model.NewId(), Password: "passwd1", AuthService: ""}
|
||||
ruser1 := th.CreateUser(&user1)
|
||||
|
||||
|
||||
@@ -827,10 +827,10 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("create guest having email domain restrictions", func(t *testing.T) {
|
||||
enableGuestDomainRestricions := *th.App.Config().GuestAccountsSettings.RestrictCreationToDomains
|
||||
enableGuestDomainRestrictions := *th.App.Config().GuestAccountsSettings.RestrictCreationToDomains
|
||||
defer func() {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
cfg.GuestAccountsSettings.RestrictCreationToDomains = &enableGuestDomainRestricions
|
||||
cfg.GuestAccountsSettings.RestrictCreationToDomains = &enableGuestDomainRestrictions
|
||||
})
|
||||
}()
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.GuestAccountsSettings.RestrictCreationToDomains = "restricted.com" })
|
||||
@@ -876,10 +876,10 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
th.BasicTeam.AllowedDomains = "restricted-team.com"
|
||||
_, err := th.App.UpdateTeam(th.BasicTeam)
|
||||
require.Nil(t, err, "Should update the team")
|
||||
enableGuestDomainRestricions := *th.App.Config().TeamSettings.RestrictCreationToDomains
|
||||
enableGuestDomainRestrictions := *th.App.Config().TeamSettings.RestrictCreationToDomains
|
||||
defer func() {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
cfg.TeamSettings.RestrictCreationToDomains = &enableGuestDomainRestricions
|
||||
cfg.TeamSettings.RestrictCreationToDomains = &enableGuestDomainRestrictions
|
||||
})
|
||||
}()
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictCreationToDomains = "restricted.com" })
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v6/store"
|
||||
)
|
||||
|
||||
func TestResctrictedViewMembers(t *testing.T) {
|
||||
func TestRestrictedViewMembers(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
|
||||
@@ -587,7 +587,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
waitUntilWebhookResposeIsCreatedAsPost := func(channel *model.Channel, th *TestHelper, createdPost chan *model.Post) {
|
||||
waitUntilWebhookResponseIsCreatedAsPost := func(channel *model.Channel, th *TestHelper, createdPost chan *model.Post) {
|
||||
go func() {
|
||||
for i := 0; i < 5; i++ {
|
||||
time.Sleep(time.Second)
|
||||
@@ -646,8 +646,8 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
|
||||
EnablePostUsernameOverride: true,
|
||||
EnablePostIconOverride: true,
|
||||
ExpectedUsername: "webhookuser",
|
||||
ExpectedIconURL: "http://webhok/icon",
|
||||
WebhookResponse: &model.OutgoingWebhookResponse{Text: &webHookResponse, Username: "webhookuser", IconURL: "http://webhok/icon"},
|
||||
ExpectedIconURL: "http://webhook/icon",
|
||||
WebhookResponse: &model.OutgoingWebhookResponse{Text: &webHookResponse, Username: "webhookuser", IconURL: "http://webhook/icon"},
|
||||
},
|
||||
}
|
||||
return testCasesOutgoing
|
||||
@@ -687,7 +687,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
|
||||
|
||||
th.App.TriggerWebhook(th.Context, payload, hook, th.BasicPost, channel)
|
||||
|
||||
waitUntilWebhookResposeIsCreatedAsPost(channel, th, createdPost)
|
||||
waitUntilWebhookResponseIsCreatedAsPost(channel, th, createdPost)
|
||||
|
||||
select {
|
||||
case webhookPost := <-createdPost:
|
||||
|
||||
Ссылка в новой задаче
Block a user