Skip to content
Snippets Groups Projects
Select Git revision
  • 278b2cbc96e4ebfbf34e21dccffb929754f9a829
  • master default protected
  • feature/PRXS-3383-CollectionsSort
  • refactor/PRXS-3053-Files
  • feature/PRXS-3143-3235-ReferenceOptions
  • feature/PRXS-3421-ImplementNewRefAPI
  • feature/PRXS-3143-LimitReferenceFields
  • feature/PRXS-3234-FeaturePruneIdents
  • feature/3149-LocaleCodeAsID-Feature
  • PRXS-3421-RecursiveReferences
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • feature/3272-GoVersionUp
  • feature/PRXS-3218-HideTemplateActions
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

setup_test.go

Blame
  • setup_test.go 33.17 KiB
    package setup
    
    import (
    	"context"
    	"testing"
    
    	"git.perx.ru/perxis/perxis-go/pkg/clients"
    	clientsMock "git.perx.ru/perxis/perxis-go/pkg/clients/mocks"
    	"git.perx.ru/perxis/perxis-go/pkg/collections"
    	collectionMock "git.perx.ru/perxis/perxis-go/pkg/collections/mocks"
    	"git.perx.ru/perxis/perxis-go/pkg/content"
    	"git.perx.ru/perxis/perxis-go/pkg/data"
    	environmentMock "git.perx.ru/perxis/perxis-go/pkg/environments/mocks"
    	"git.perx.ru/perxis/perxis-go/pkg/errors"
    	"git.perx.ru/perxis/perxis-go/pkg/extension"
    	"git.perx.ru/perxis/perxis-go/pkg/items"
    	itemsMock "git.perx.ru/perxis/perxis-go/pkg/items/mocks"
    	"git.perx.ru/perxis/perxis-go/pkg/roles"
    	rolesMock "git.perx.ru/perxis/perxis-go/pkg/roles/mocks"
    	"git.perx.ru/perxis/perxis-go/pkg/schema"
    	"github.com/stretchr/testify/assert"
    	"github.com/stretchr/testify/mock"
    	"github.com/stretchr/testify/require"
    	"go.uber.org/zap/zaptest"
    )
    
    const (
    	spaceID = "sp"
    	envID   = "env"
    )
    
    func getCollections() []*collections.Collection {
    	return []*collections.Collection{
    		{
    			ID:      "coll1",
    			SpaceID: spaceID,
    			EnvID:   envID,
    			Schema:  schema.New(),
    			Name:    "Коллекция",
    		},
    	}
    }
    
    func getRoles() []*roles.Role {
    	return []*roles.Role{
    		{
    			ID:      "role",
    			SpaceID: spaceID,
    		},
    	}
    }
    
    func getClients() []*clients.Client {
    	return []*clients.Client{
    		{
    			ID:      "client",
    			SpaceID: spaceID,
    			RoleID:  "role",
    		},
    	}
    }
    
    func getActions() []*items.Item {
    	return []*items.Item{
    		{
    			ID:           "act",
    			SpaceID:      spaceID,
    			EnvID:        envID,
    			CollectionID: extension.ActionsCollectionID,
    			Data: map[string]interface{}{