fix unit tests

This commit is contained in:
Michael Barz
2022-09-15 10:42:00 +02:00
parent 23da13b35f
commit a129ea6abe
2 changed files with 10 additions and 4 deletions

View File

@@ -586,7 +586,7 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
}
webURL.Path = path.Join(webURL.Path, "f", storagespace.FormatResourceID(spaceRid))
drive.Root.WebUrl = libregraph.PtrString(webURL.String())
drive.WebUrl = libregraph.PtrString(webURL.String())
if space.Owner != nil && space.Owner.Id != nil {
drive.Owner = &libregraph.IdentitySet{

View File

@@ -17,6 +17,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
"github.com/owncloud/ocis/v2/services/graph/mocks"
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
"github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults"
@@ -39,6 +40,8 @@ var _ = Describe("Graph", func() {
cfg = defaults.FullDefaultConfig()
cfg.Identity.LDAP.CACert = "" // skip the startup checks, we don't use LDAP at all in this tests
cfg.TokenManager.JWTSecret = "loremipsum"
cfg.Commons = &shared.Commons{}
cfg.Commons.OcisURL = "https://ocis.test"
gatewayClient = &mocks.GatewayClient{}
eventsPublisher = mocks.Publisher{}
@@ -108,7 +111,8 @@ var _ = Describe("Graph", func() {
"root":{
"id":"pro-1$sameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$sameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$sameID"
}
]
}
@@ -178,7 +182,8 @@ var _ = Describe("Graph", func() {
"eTag":"101112131415",
"id":"pro-1$asameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$asameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$asameID"
},
{
"driveAlias":"bspacetype/bspacename",
@@ -189,7 +194,8 @@ var _ = Describe("Graph", func() {
"eTag":"123456789",
"id":"pro-1$bsameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$bsameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$bsameID"
}
]
}