mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 07:15:23 +02:00
fix(teams): create more then one team [EE-2184] (#6305)
fixes [EE-2184]
This commit is contained in:
parent
cdfa9b25a8
commit
8fc5a5e8a1
3 changed files with 82 additions and 1 deletions
28
api/dataservices/team/tests/utils.go
Normal file
28
api/dataservices/team/tests/utils.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/datastore"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type teamBuilder struct {
|
||||
t *testing.T
|
||||
count int
|
||||
store *datastore.Store
|
||||
}
|
||||
|
||||
func (b *teamBuilder) createNew(name string) *portainer.Team {
|
||||
b.count++
|
||||
team := &portainer.Team{
|
||||
ID: portainer.TeamID(b.count),
|
||||
Name: name,
|
||||
}
|
||||
|
||||
err := b.store.Team().Create(team)
|
||||
assert.NoError(b.t, err)
|
||||
|
||||
return team
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue