PLT-4938 Add app package and move logic over from api package (#4931)
* Add app package and move logic over from api package * Change app package functions to return errors * Move non-api tests into app package * Fix merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
07bad4d6d5
Коммит
97558f6a6e
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/platform/app"
|
||||
"github.com/mattermost/platform/model"
|
||||
)
|
||||
|
||||
@@ -108,7 +109,7 @@ func TestCliCreateUserWithoutTeam(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if result := <-Srv.Store.User().GetByEmail(email); result.Err != nil {
|
||||
if result := <-app.Srv.Store.User().GetByEmail(email); result.Err != nil {
|
||||
t.Fatal()
|
||||
} else {
|
||||
user := result.Data.(*model.User)
|
||||
@@ -132,7 +133,7 @@ func TestCliAssignRole(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if result := <-Srv.Store.User().GetByEmail(th.BasicUser.Email); result.Err != nil {
|
||||
if result := <-app.Srv.Store.User().GetByEmail(th.BasicUser.Email); result.Err != nil {
|
||||
t.Fatal()
|
||||
} else {
|
||||
user := result.Data.(*model.User)
|
||||
@@ -370,7 +371,7 @@ func TestCliLeaveTeam(t *testing.T) {
|
||||
t.Fatal("profile should not be on team")
|
||||
}
|
||||
|
||||
if result := <-Srv.Store.Team().GetTeamsByUserId(th.BasicUser.Id); result.Err != nil {
|
||||
if result := <-app.Srv.Store.Team().GetTeamsByUserId(th.BasicUser.Id); result.Err != nil {
|
||||
teamMembers := result.Data.([]*model.TeamMember)
|
||||
if len(teamMembers) > 0 {
|
||||
t.Fatal("Shouldn't be in team")
|
||||
|
||||
Ссылка в новой задаче
Block a user