[MM-53086] Remove SendWelcomePost A/B test and feature (#23733)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Julien Tant
2023-06-16 12:13:23 -07:00
коммит произвёл GitHub
родитель de61b9b687
Коммит 86f0877799
20 изменённых файлов: 1 добавлений и 474 удалений

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

@@ -1875,57 +1875,6 @@ func TestCreateUserWithInitialPreferences(t *testing.T) {
})
}
func TestIsFirstAdmin(t *testing.T) {
t.Run("should return false if user is not sysadmin", func(t *testing.T) {
th := SetupWithStoreMock(t)
defer th.TearDown()
Id := model.NewId()
isFirstAdmin := th.App.IsFirstAdmin(&model.User{
Id: Id,
Roles: model.SystemUserRoleId,
})
require.False(t, isFirstAdmin)
})
t.Run("should return false if user is sysadmin but not the first one", func(t *testing.T) {
th := SetupWithStoreMock(t)
defer th.TearDown()
Id := model.NewId()
mockUserStore := storemocks.UserStore{}
mockUserStore.On("GetFirstSystemAdminID").Return(model.NewId(), nil)
mockStore := th.App.Srv().Store().(*storemocks.Store)
mockStore.On("User").Return(&mockUserStore)
isFirstAdmin := th.App.IsFirstAdmin(&model.User{
Id: Id,
Roles: model.SystemAdminRoleId,
})
require.False(t, isFirstAdmin)
})
t.Run("should return true if user is sysadmin and the first one", func(t *testing.T) {
th := SetupWithStoreMock(t)
defer th.TearDown()
Id := model.NewId()
mockStore := th.App.Srv().Store().(*storemocks.Store)
mockUserStore := storemocks.UserStore{}
mockUserStore.On("GetFirstSystemAdminID").Return(Id, nil)
mockStore.On("User").Return(&mockUserStore)
isFirstAdmin := th.App.IsFirstAdmin(&model.User{
Id: Id,
Roles: model.SystemAdminRoleId,
})
require.True(t, isFirstAdmin)
})
}
func TestSendSubscriptionHistoryEvent(t *testing.T) {
cloudProduct := &model.Product{
ID: "prod_test1",