Fix user creation via wf

This commit is contained in:
Denis Arh
2021-07-15 20:36:57 +02:00
parent cfb757230e
commit ec6ecf1132
4 changed files with 61 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
package workflows
import (
"context"
"testing"
autTypes "github.com/cortezaproject/corteza-server/automation/types"
sysTypes "github.com/cortezaproject/corteza-server/system/types"
"github.com/stretchr/testify/require"
)
func Test0003_create_user(t *testing.T) {
var (
ctx = bypassRBAC(context.Background())
req = require.New(t)
)
loadScenario(ctx, t)
var (
aux = struct {
User *sysTypes.User
}{}
vars, _ = mustExecWorkflow(ctx, t, "create-user", autTypes.WorkflowExecParams{})
)
req.NoError(vars.Decode(&aux))
}
@@ -0,0 +1,24 @@
workflows:
create-user:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 1
steps:
- stepID: 1
kind: expressions
arguments:
- { target: dummy, type: User }
- { target: dummy.email, type: String, value: "some.email@domain.tld" }
- { target: dummy.name, type: String, value: "Not Sure" }
- stepID: 2
kind: function
ref: usersCreate
arguments:
- { target: user, type: User, expr: "dummy" }
paths:
- { parentID: 1, childID: 2 }