[MM-28985] Remove pointers to slice (part 1) (#18034)
* Remove pointers to slice (part 1) * Remove use of pointers to slice from model package (#18045) * Fix after merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
132f114793
Коммит
04b27ce93c
@@ -782,7 +782,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
|
||||
members, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, newUser.Id)
|
||||
require.Nil(t, err)
|
||||
assert.Len(t, *members, 2)
|
||||
assert.Len(t, members, 2)
|
||||
})
|
||||
|
||||
t.Run("valid guest request", func(t *testing.T) {
|
||||
@@ -803,8 +803,8 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
|
||||
members, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, newGuest.Id)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, *members, 1)
|
||||
assert.Equal(t, (*members)[0].ChannelId, th.BasicChannel.Id)
|
||||
require.Len(t, members, 1)
|
||||
assert.Equal(t, members[0].ChannelId, th.BasicChannel.Id)
|
||||
})
|
||||
|
||||
t.Run("create guest having email domain restrictions", func(t *testing.T) {
|
||||
@@ -848,8 +848,8 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
|
||||
members, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, newGuest.Id)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, *members, 1)
|
||||
assert.Equal(t, (*members)[0].ChannelId, th.BasicChannel.Id)
|
||||
require.Len(t, members, 1)
|
||||
assert.Equal(t, members[0].ChannelId, th.BasicChannel.Id)
|
||||
})
|
||||
|
||||
t.Run("create guest having team and system email domain restrictions", func(t *testing.T) {
|
||||
@@ -885,8 +885,8 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
|
||||
members, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, newGuest.Id)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, *members, 1)
|
||||
assert.Equal(t, (*members)[0].ChannelId, th.BasicChannel.Id)
|
||||
require.Len(t, members, 1)
|
||||
assert.Equal(t, members[0].ChannelId, th.BasicChannel.Id)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1183,7 +1183,7 @@ func TestPromoteGuestToUser(t *testing.T) {
|
||||
|
||||
channelMembers, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, guest.Id)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, *channelMembers, 1)
|
||||
require.Len(t, channelMembers, 1)
|
||||
|
||||
err = th.App.PromoteGuestToUser(th.Context, guest, th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
@@ -1201,7 +1201,7 @@ func TestPromoteGuestToUser(t *testing.T) {
|
||||
|
||||
channelMembers, err = th.App.GetChannelMembersForUser(th.BasicTeam.Id, guest.Id)
|
||||
require.Nil(t, err)
|
||||
assert.Len(t, *channelMembers, 3)
|
||||
assert.Len(t, channelMembers, 3)
|
||||
})
|
||||
|
||||
t.Run("Must invalidate channel stats cache when promoting a guest", func(t *testing.T) {
|
||||
@@ -1346,7 +1346,7 @@ func TestDemoteUserToGuest(t *testing.T) {
|
||||
|
||||
channelMembers, err := th.App.GetChannelMembersForUser(th.BasicTeam.Id, user.Id)
|
||||
require.Nil(t, err)
|
||||
require.Len(t, *channelMembers, 3)
|
||||
require.Len(t, channelMembers, 3)
|
||||
|
||||
err = th.App.DemoteUserToGuest(user)
|
||||
require.Nil(t, err)
|
||||
@@ -1364,7 +1364,7 @@ func TestDemoteUserToGuest(t *testing.T) {
|
||||
|
||||
channelMembers, err = th.App.GetChannelMembersForUser(th.BasicTeam.Id, user.Id)
|
||||
require.Nil(t, err)
|
||||
assert.Len(t, *channelMembers, 3)
|
||||
assert.Len(t, channelMembers, 3)
|
||||
})
|
||||
|
||||
t.Run("Must be removed as team and channel admin", func(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user