mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* Added enable/disable setting and feature flag * added rest of notifgication settings * Added backend for content flagging setting and populated notification values from server side defaults * WIP user selector * Added common reviewers UI * Added additonal reviewers section * WIP * WIP * Team table base * Added search in teams * Added search in teams * Added additional settings section * WIP * Inbtegrated reviewers settings * WIP * WIP * Added server side validation * cleanup * cleanup * [skip ci] * Some refactoring * type fixes * lint fix * test: add content flagging settings test file * test: add comprehensive unit tests for content flagging settings * enhanced tests * test: add test file for content flagging additional settings * test: add comprehensive unit tests for ContentFlaggingAdditionalSettingsSection * Added additoonal settings test * test: add empty test file for team reviewers section * test: add comprehensive unit tests for TeamReviewersSection component * test: update tests to handle async data fetching in team reviewers section * test: add empty test file for content reviewers component * feat: add comprehensive unit tests for ContentFlaggingContentReviewers component * Added ContentFlaggingContentReviewersContentFlaggingContentReviewers test * test: add notification settings test file for content flagging * test: add comprehensive unit tests for content flagging notification settings * Added ContentFlaggingNotificationSettingsSection tests * test: add user profile pill test file * test: add comprehensive unit tests for UserProfilePill component * refactor: Replace enzyme shallow with renderWithContext in user_profile_pill tests * Added UserProfilePill tests * test: add empty test file for content reviewers team option * test: add comprehensive unit tests for TeamOptionComponent * Added TeamOptionComponent tests * test: add empty test file for reason_option component * test: add comprehensive unit tests for ReasonOption component * Added ReasonOption tests * cleanup * Fixed i18n error * fixed e2e test lijnt issues * Updated test cases * Added snaoshot * Updated snaoshot * lint fix * WIP * lint fix * Added post flagging properties setup * review fixes * updated snapshot * CI * Added base APIs * Fetched team status data on load and team switch * WIP * Review fixes * wip * WIP * Removed an test, updated comment * CI * Added tests * Added tests * Lint fix * Added API specs * Fixed types * CI fixes * API tests * lint fixes * Set env variable so API routes are regiustered * Test update * term renaming and disabling API tests on MySQL * typo * Updated store type definition * Minor tweaks * Added tests * Removed error in app startup when content flaghging setup fails * Updated sync condition: * Flag message modal basE * added post preview * displaying options * Adde comment input * Updated tests and docs * finction rename * WIP * Updated tests * refactor * lint fix * MOved to data migration * lint fix * CI * added new migration mocks * Used setup for tests * some comment * Removed unnecesseery nil check * Form validation * WIP tests * WIP tests * WIP tests * fix: mock content flagging config selector with correct reasons format * fix: add mock for getContentFlaggingConfig in flag post modal test * Updated error code order in API docs * removed empty files * Added tests * lint fixes * minor tweak * lint fix * type fix * fixed test * nit * test enhancements * API WIP * API WIP * creating values * creating content flagging channel and properties * Able to save properties * Added another property field * WIP * WIP * Added validations * Added data validations and hidden post if confifgured to * lint fixes * Added API spec * Added some tests * Added tests for getContentReviewBot * test: add comprehensive tests for getContentReviewChannels function * Added more app layer tests * Added TestCanFlagPost * test: Add comprehensive tests for FlagPost function * Added all app layer tests * Removed a file that was reamoved downstream * test: add content flagging test file * test: add comprehensive tests for FlagContentRequest.IsValid method * Added model tests * test: add comprehensive tests for SqlPropertyValueStore.CreateMany * test: add comprehensive tests for flagPost() API function * Added API tests * linter fix * WIP * sent post flagging confirmation message * fixed i18n nissues * fixed i18n nissues * CI * Updated test * fix: reset contentFlaggingGroupId for test isolation in content flagging tests * removed cached group ID * removed debug log * review fixes * Used correct ot name * CI * Updated mobile text * Handled JSON error * fixerdf i18n * CI * Integrate flag post api (#33798) * WIP * WIP * Added API call * test: add test for Client4.flagPost API call in FlagPostModal * fix: remove userEvent.setup() from flag post modal test * test: wrap submit button click in act for proper state updates * Updated tests * lint fix * CI * Updated to allow special characters in comments * Handled empty comment * Used finally * CI * Fixed test * Spillage card integration (#33832) * Created getContentFlaggingFields API * created getPostPropertyValues API * WIP * Created useContentFlaggingFields hook * WIP * WIP * Added option to retain data for reviewers * Displayed deleted post's preview * DIsplayed all properties * Adding field name i18n * WIP - managing i18n able texts * Finished displaying all fields * Manual cleanup * lint fixes * team role filter logic fix * Fixed tests * created new API to fetch flagged posts * lint fix * Added new client methods * test: add comprehensive tests for content flagging APIs * Added new API tests * fixed openapi spec * Fixed DataSpillageReport tests * Fixed PostMarkdown test * Fixed PostPreviewPropertyRenderer test * Added metadata to card renderer * test fixes * Added no comment placeholder * Fixed test * refactor: improve test mocking for data spillage report component * test mock updates * Updated reducer * not resetting mocks * WIP * review fixes * CI * Fixed * fixes * Content flagging actions implementation (#33852) * Added view detail button * Created RemoveFlaggedMessageConfirmationModal modal * Added key and remove flag request modal * IMplemented delete flagged post * Handled edge cases of deleting flagged post * keep message * UI integration * Added WS event for post report update and handled deleted files of flagged post * Added error handling in keep/remove forms * i18n fixes * Updated OpenAPI specs * fixed types * fixed types * refactoring * Fixed tests * review fixes * Added new property translations * Improved test * fixed test * CI * fixes * CI * fixed a test * CI --------- Co-authored-by: Hanzo Dev <[email protected]>
804 lines
24 KiB
Go
804 lines
24 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make sharedchannel-mocks`.
|
|
|
|
package sharedchannel
|
|
|
|
import (
|
|
filestore "github.com/mattermost/mattermost/server/v8/platform/shared/filestore"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
)
|
|
|
|
// MockAppIface is an autogenerated mock type for the AppIface type
|
|
type MockAppIface struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AddUserToChannel provides a mock function with given fields: rctx, user, channel, skipTeamMemberIntegrityCheck
|
|
func (_m *MockAppIface) AddUserToChannel(rctx request.CTX, user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError) {
|
|
ret := _m.Called(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AddUserToChannel")
|
|
}
|
|
|
|
var r0 *model.ChannelMember
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) (*model.ChannelMember, *model.AppError)); ok {
|
|
return rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) *model.ChannelMember); ok {
|
|
r0 = rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.User, *model.Channel, bool) *model.AppError); ok {
|
|
r1 = rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// AddUserToTeamByTeamId provides a mock function with given fields: rctx, teamId, user
|
|
func (_m *MockAppIface) AddUserToTeamByTeamId(rctx request.CTX, teamId string, user *model.User) *model.AppError {
|
|
ret := _m.Called(rctx, teamId, user)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AddUserToTeamByTeamId")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.User) *model.AppError); ok {
|
|
r0 = rf(rctx, teamId, user)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// CreateChannelWithUser provides a mock function with given fields: rctx, channel, userId
|
|
func (_m *MockAppIface) CreateChannelWithUser(rctx request.CTX, channel *model.Channel, userId string) (*model.Channel, *model.AppError) {
|
|
ret := _m.Called(rctx, channel, userId)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateChannelWithUser")
|
|
}
|
|
|
|
var r0 *model.Channel
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) (*model.Channel, *model.AppError)); ok {
|
|
return rf(rctx, channel, userId)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) *model.Channel); ok {
|
|
r0 = rf(rctx, channel, userId)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, string) *model.AppError); ok {
|
|
r1 = rf(rctx, channel, userId)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreateGroupChannel provides a mock function with given fields: rctx, userIDs, creatorId, channelOptions
|
|
func (_m *MockAppIface) CreateGroupChannel(rctx request.CTX, userIDs []string, creatorId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) {
|
|
_va := make([]interface{}, len(channelOptions))
|
|
for _i := range channelOptions {
|
|
_va[_i] = channelOptions[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, rctx, userIDs, creatorId)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateGroupChannel")
|
|
}
|
|
|
|
var r0 *model.Channel
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, ...model.ChannelOption) (*model.Channel, *model.AppError)); ok {
|
|
return rf(rctx, userIDs, creatorId, channelOptions...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, ...model.ChannelOption) *model.Channel); ok {
|
|
r0 = rf(rctx, userIDs, creatorId, channelOptions...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, []string, string, ...model.ChannelOption) *model.AppError); ok {
|
|
r1 = rf(rctx, userIDs, creatorId, channelOptions...)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreatePost provides a mock function with given fields: rctx, post, channel, flags
|
|
func (_m *MockAppIface) CreatePost(rctx request.CTX, post *model.Post, channel *model.Channel, flags model.CreatePostFlags) (*model.Post, *model.AppError) {
|
|
ret := _m.Called(rctx, post, channel, flags)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreatePost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) (*model.Post, *model.AppError)); ok {
|
|
return rf(rctx, post, channel, flags)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) *model.Post); ok {
|
|
r0 = rf(rctx, post, channel, flags)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) *model.AppError); ok {
|
|
r1 = rf(rctx, post, channel, flags)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreateUploadSession provides a mock function with given fields: rctx, us
|
|
func (_m *MockAppIface) CreateUploadSession(rctx request.CTX, us *model.UploadSession) (*model.UploadSession, *model.AppError) {
|
|
ret := _m.Called(rctx, us)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateUploadSession")
|
|
}
|
|
|
|
var r0 *model.UploadSession
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) (*model.UploadSession, *model.AppError)); ok {
|
|
return rf(rctx, us)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) *model.UploadSession); ok {
|
|
r0 = rf(rctx, us)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.UploadSession)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.UploadSession) *model.AppError); ok {
|
|
r1 = rf(rctx, us)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeleteAcknowledgementForPostWithModel provides a mock function with given fields: rctx, acknowledgement
|
|
func (_m *MockAppIface) DeleteAcknowledgementForPostWithModel(rctx request.CTX, acknowledgement *model.PostAcknowledgement) *model.AppError {
|
|
ret := _m.Called(rctx, acknowledgement)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteAcknowledgementForPostWithModel")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) *model.AppError); ok {
|
|
r0 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DeletePost provides a mock function with given fields: rctx, postID, deleteByID
|
|
func (_m *MockAppIface) DeletePost(rctx request.CTX, postID string, deleteByID string) (*model.Post, *model.AppError) {
|
|
ret := _m.Called(rctx, postID, deleteByID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeletePost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.Post, *model.AppError)); ok {
|
|
return rf(rctx, postID, deleteByID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.Post); ok {
|
|
r0 = rf(rctx, postID, deleteByID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
|
r1 = rf(rctx, postID, deleteByID)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeleteReactionForPost provides a mock function with given fields: rctx, reaction
|
|
func (_m *MockAppIface) DeleteReactionForPost(rctx request.CTX, reaction *model.Reaction) *model.AppError {
|
|
ret := _m.Called(rctx, reaction)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteReactionForPost")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.AppError); ok {
|
|
r0 = rf(rctx, reaction)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// FileReader provides a mock function with given fields: path
|
|
func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) {
|
|
ret := _m.Called(path)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FileReader")
|
|
}
|
|
|
|
var r0 filestore.ReadCloseSeeker
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string) (filestore.ReadCloseSeeker, *model.AppError)); ok {
|
|
return rf(path)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(filestore.ReadCloseSeeker)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAcknowledgementsForPost provides a mock function with given fields: postID
|
|
func (_m *MockAppIface) GetAcknowledgementsForPost(postID string) ([]*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(postID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAcknowledgementsForPost")
|
|
}
|
|
|
|
var r0 []*model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(postID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) []*model.PostAcknowledgement); ok {
|
|
r0 = rf(postID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(postID)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetOrCreateDirectChannel provides a mock function with given fields: rctx, userId, otherUserId, channelOptions
|
|
func (_m *MockAppIface) GetOrCreateDirectChannel(rctx request.CTX, userId string, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) {
|
|
_va := make([]interface{}, len(channelOptions))
|
|
for _i := range channelOptions {
|
|
_va[_i] = channelOptions[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, rctx, userId, otherUserId)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetOrCreateDirectChannel")
|
|
}
|
|
|
|
var r0 *model.Channel
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) (*model.Channel, *model.AppError)); ok {
|
|
return rf(rctx, userId, otherUserId, channelOptions...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) *model.Channel); ok {
|
|
r0 = rf(rctx, userId, otherUserId, channelOptions...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string, ...model.ChannelOption) *model.AppError); ok {
|
|
r1 = rf(rctx, userId, otherUserId, channelOptions...)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetProfileImage provides a mock function with given fields: user
|
|
func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) {
|
|
ret := _m.Called(user)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetProfileImage")
|
|
}
|
|
|
|
var r0 []byte
|
|
var r1 bool
|
|
var r2 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(*model.User) ([]byte, bool, *model.AppError)); ok {
|
|
return rf(user)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.User) []byte); ok {
|
|
r0 = rf(user)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.User) bool); ok {
|
|
r1 = rf(user)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(*model.User) *model.AppError); ok {
|
|
r2 = rf(user)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// MentionsToTeamMembers provides a mock function with given fields: rctx, message, teamID
|
|
func (_m *MockAppIface) MentionsToTeamMembers(rctx request.CTX, message string, teamID string) model.UserMentionMap {
|
|
ret := _m.Called(rctx, message, teamID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for MentionsToTeamMembers")
|
|
}
|
|
|
|
var r0 model.UserMentionMap
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) model.UserMentionMap); ok {
|
|
r0 = rf(rctx, message, teamID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(model.UserMentionMap)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NotifySharedChannelUserUpdate provides a mock function with given fields: user
|
|
func (_m *MockAppIface) NotifySharedChannelUserUpdate(user *model.User) {
|
|
_m.Called(user)
|
|
}
|
|
|
|
// OnSharedChannelsAttachmentSyncMsg provides a mock function with given fields: fi, post, rc
|
|
func (_m *MockAppIface) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error {
|
|
ret := _m.Called(fi, post, rc)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for OnSharedChannelsAttachmentSyncMsg")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(*model.FileInfo, *model.Post, *model.RemoteCluster) error); ok {
|
|
r0 = rf(fi, post, rc)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// OnSharedChannelsProfileImageSyncMsg provides a mock function with given fields: user, rc
|
|
func (_m *MockAppIface) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error {
|
|
ret := _m.Called(user, rc)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for OnSharedChannelsProfileImageSyncMsg")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(*model.User, *model.RemoteCluster) error); ok {
|
|
r0 = rf(user, rc)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// OnSharedChannelsSyncMsg provides a mock function with given fields: msg, rc
|
|
func (_m *MockAppIface) OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error) {
|
|
ret := _m.Called(msg, rc)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for OnSharedChannelsSyncMsg")
|
|
}
|
|
|
|
var r0 model.SyncResponse
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.SyncMsg, *model.RemoteCluster) (model.SyncResponse, error)); ok {
|
|
return rf(msg, rc)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.SyncMsg, *model.RemoteCluster) model.SyncResponse); ok {
|
|
r0 = rf(msg, rc)
|
|
} else {
|
|
r0 = ret.Get(0).(model.SyncResponse)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.SyncMsg, *model.RemoteCluster) error); ok {
|
|
r1 = rf(msg, rc)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PatchChannelModerationsForChannel provides a mock function with given fields: rctx, channel, channelModerationsPatch
|
|
func (_m *MockAppIface) PatchChannelModerationsForChannel(rctx request.CTX, channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) {
|
|
ret := _m.Called(rctx, channel, channelModerationsPatch)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for PatchChannelModerationsForChannel")
|
|
}
|
|
|
|
var r0 []*model.ChannelModeration
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError)); ok {
|
|
return rf(rctx, channel, channelModerationsPatch)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) []*model.ChannelModeration); ok {
|
|
r0 = rf(rctx, channel, channelModerationsPatch)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.ChannelModeration)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) *model.AppError); ok {
|
|
r1 = rf(rctx, channel, channelModerationsPatch)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PermanentDeleteChannel provides a mock function with given fields: rctx, channel
|
|
func (_m *MockAppIface) PermanentDeleteChannel(rctx request.CTX, channel *model.Channel) *model.AppError {
|
|
ret := _m.Called(rctx, channel)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for PermanentDeleteChannel")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel) *model.AppError); ok {
|
|
r0 = rf(rctx, channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// PreparePostForClient provides a mock function with given fields: rctx, post, opts
|
|
func (_m *MockAppIface) PreparePostForClient(rctx request.CTX, post *model.Post, opts *model.PreparePostForClientOpts) *model.Post {
|
|
ret := _m.Called(rctx, post, opts)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for PreparePostForClient")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.PreparePostForClientOpts) *model.Post); ok {
|
|
r0 = rf(rctx, post, opts)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Publish provides a mock function with given fields: message
|
|
func (_m *MockAppIface) Publish(message *model.WebSocketEvent) {
|
|
_m.Called(message)
|
|
}
|
|
|
|
// RemoveUserFromChannel provides a mock function with given fields: rctx, userID, removerUserId, channel
|
|
func (_m *MockAppIface) RemoveUserFromChannel(rctx request.CTX, userID string, removerUserId string, channel *model.Channel) *model.AppError {
|
|
ret := _m.Called(rctx, userID, removerUserId, channel)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveUserFromChannel")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, *model.Channel) *model.AppError); ok {
|
|
r0 = rf(rctx, userID, removerUserId, channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SaveAcknowledgementForPostWithModel provides a mock function with given fields: rctx, acknowledgement
|
|
func (_m *MockAppIface) SaveAcknowledgementForPostWithModel(rctx request.CTX, acknowledgement *model.PostAcknowledgement) (*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(rctx, acknowledgement)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAcknowledgementForPostWithModel")
|
|
}
|
|
|
|
var r0 *model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) (*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(rctx, acknowledgement)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) *model.PostAcknowledgement); ok {
|
|
r0 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.PostAcknowledgement) *model.AppError); ok {
|
|
r1 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveAcknowledgementsForPost provides a mock function with given fields: rctx, postID, userIDs
|
|
func (_m *MockAppIface) SaveAcknowledgementsForPost(rctx request.CTX, postID string, userIDs []string) ([]*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(rctx, postID, userIDs)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAcknowledgementsForPost")
|
|
}
|
|
|
|
var r0 []*model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) ([]*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(rctx, postID, userIDs)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) []*model.PostAcknowledgement); ok {
|
|
r0 = rf(rctx, postID, userIDs)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, []string) *model.AppError); ok {
|
|
r1 = rf(rctx, postID, userIDs)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveAndBroadcastStatus provides a mock function with given fields: status
|
|
func (_m *MockAppIface) SaveAndBroadcastStatus(status *model.Status) {
|
|
_m.Called(status)
|
|
}
|
|
|
|
// SaveReactionForPost provides a mock function with given fields: rctx, reaction
|
|
func (_m *MockAppIface) SaveReactionForPost(rctx request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
|
ret := _m.Called(rctx, reaction)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveReactionForPost")
|
|
}
|
|
|
|
var r0 *model.Reaction
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) (*model.Reaction, *model.AppError)); ok {
|
|
return rf(rctx, reaction)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.Reaction); ok {
|
|
r0 = rf(rctx, reaction)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Reaction)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Reaction) *model.AppError); ok {
|
|
r1 = rf(rctx, reaction)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SendEphemeralPost provides a mock function with given fields: rctx, userId, post
|
|
func (_m *MockAppIface) SendEphemeralPost(rctx request.CTX, userId string, post *model.Post) *model.Post {
|
|
ret := _m.Called(rctx, userId, post)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SendEphemeralPost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.Post) *model.Post); ok {
|
|
r0 = rf(rctx, userId, post)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdatePost provides a mock function with given fields: rctx, post, updatePostOptions
|
|
func (_m *MockAppIface) UpdatePost(rctx request.CTX, post *model.Post, updatePostOptions *model.UpdatePostOptions) (*model.Post, *model.AppError) {
|
|
ret := _m.Called(rctx, post, updatePostOptions)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdatePost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.UpdatePostOptions) (*model.Post, *model.AppError)); ok {
|
|
return rf(rctx, post, updatePostOptions)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.UpdatePostOptions) *model.Post); ok {
|
|
r0 = rf(rctx, post, updatePostOptions)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.UpdatePostOptions) *model.AppError); ok {
|
|
r1 = rf(rctx, post, updatePostOptions)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UserCanSeeOtherUser provides a mock function with given fields: rctx, userID, otherUserId
|
|
func (_m *MockAppIface) UserCanSeeOtherUser(rctx request.CTX, userID string, otherUserId string) (bool, *model.AppError) {
|
|
ret := _m.Called(rctx, userID, otherUserId)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UserCanSeeOtherUser")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (bool, *model.AppError)); ok {
|
|
return rf(rctx, userID, otherUserId)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) bool); ok {
|
|
r0 = rf(rctx, userID, otherUserId)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
|
r1 = rf(rctx, userID, otherUserId)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewMockAppIface creates a new instance of MockAppIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewMockAppIface(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockAppIface {
|
|
mock := &MockAppIface{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|