3
0

Fix tests

This commit is contained in:
Tomaž Jerman 2024-10-03 14:37:57 +02:00 committed by Jože Fortun
parent 35cd56900f
commit baaeb2c2f1
4 changed files with 24 additions and 0 deletions

View File

@ -86,6 +86,9 @@ func Test_namespace_duplicate(t *testing.T) {
helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.search")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.search")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "pages.search")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "read")
helpers.AllowMe(h, types.ModuleRbacResource(0, 0), "read")
helpers.AllowMe(h, types.PageRbacResource(0, 0), "read")

View File

@ -2,6 +2,9 @@ package compose
import (
"testing"
"github.com/cortezaproject/corteza/server/compose/types"
"github.com/cortezaproject/corteza/server/tests/helpers"
)
func Test_namespace_export_automation(t *testing.T) {
@ -12,6 +15,10 @@ func Test_namespace_export_automation(t *testing.T) {
ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1")
h.a.NoError(err)
helpers.AllowMe(h, types.NamespaceRbacResource(0), "export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export")
arch := namespaceExportSafe(t, h, ns.ID)
sessionID := namespaceImportInitSafe(t, h, arch)
ns, _, pp, _ := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported")

View File

@ -2,6 +2,9 @@ package compose
import (
"testing"
"github.com/cortezaproject/corteza/server/compose/types"
"github.com/cortezaproject/corteza/server/tests/helpers"
)
func Test_namespace_export_empty(t *testing.T) {
@ -12,6 +15,10 @@ func Test_namespace_export_empty(t *testing.T) {
ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1")
h.a.NoError(err)
helpers.AllowMe(h, types.NamespaceRbacResource(0), "export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export")
arch := namespaceExportSafe(t, h, ns.ID)
sessionID := namespaceImportInitSafe(t, h, arch)
ns, mm, pp, cc := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported")

View File

@ -2,6 +2,9 @@ package compose
import (
"testing"
"github.com/cortezaproject/corteza/server/compose/types"
"github.com/cortezaproject/corteza/server/tests/helpers"
)
func Test_namespace_export_simple(t *testing.T) {
@ -12,6 +15,10 @@ func Test_namespace_export_simple(t *testing.T) {
ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1")
h.a.NoError(err)
helpers.AllowMe(h, types.NamespaceRbacResource(0), "export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export")
helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export")
arch := namespaceExportSafe(t, h, ns.ID)
sessionID := namespaceImportInitSafe(t, h, arch)
ns, mm, pp, cc := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported")