fix API tests
This commit is contained in:
@@ -166,14 +166,15 @@ func (g Graph) GetSpecialSpaceItems(ctx context.Context, baseURL *url.URL, space
|
|||||||
readmeItem, err := g.getDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: readmeID})
|
readmeItem, err := g.getDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: readmeID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.logger.Error().Err(err).Str("ID", readmeID).Msg("Could not get readme Item")
|
g.logger.Error().Err(err).Str("ID", readmeID).Msg("Could not get readme Item")
|
||||||
}
|
|
||||||
readmePath, err := g.getPathForDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: readmeID})
|
|
||||||
if err != nil {
|
|
||||||
g.logger.Error().Err(err).Str("ID", readmeID).Msg("Could not get readme path")
|
|
||||||
} else {
|
} else {
|
||||||
readmeItem.SpecialFolder = &libregraph.SpecialFolder{Name: libregraph.PtrString(ReadmeSpecialFolderName)}
|
readmePath, err := g.getPathForDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: readmeID})
|
||||||
readmeItem.WebDavUrl = libregraph.PtrString(baseURL.String() + filepath.Join(space.Root.OpaqueId, *readmePath))
|
if err != nil {
|
||||||
spaceItems = append(spaceItems, *readmeItem)
|
g.logger.Error().Err(err).Str("ID", readmeID).Msg("Could not get readme path")
|
||||||
|
} else {
|
||||||
|
readmeItem.SpecialFolder = &libregraph.SpecialFolder{Name: libregraph.PtrString(ReadmeSpecialFolderName)}
|
||||||
|
readmeItem.WebDavUrl = libregraph.PtrString(baseURL.String() + filepath.Join(space.Root.OpaqueId, *readmePath))
|
||||||
|
spaceItems = append(spaceItems, *readmeItem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,14 +184,15 @@ func (g Graph) GetSpecialSpaceItems(ctx context.Context, baseURL *url.URL, space
|
|||||||
imageItem, err := g.getDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: imageID})
|
imageItem, err := g.getDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: imageID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.logger.Error().Err(err).Str("ID", imageID).Msg("Could not get image Item")
|
g.logger.Error().Err(err).Str("ID", imageID).Msg("Could not get image Item")
|
||||||
}
|
|
||||||
imagePath, err := g.getPathForDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: imageID})
|
|
||||||
if err != nil {
|
|
||||||
g.logger.Error().Err(err).Str("ID", imageID).Msg("Could not get image path")
|
|
||||||
} else {
|
} else {
|
||||||
imageItem.SpecialFolder = &libregraph.SpecialFolder{Name: libregraph.PtrString(SpaceImageSpecialFolderName)}
|
imagePath, err := g.getPathForDriveItem(ctx, &storageprovider.ResourceId{StorageId: space.Root.StorageId, OpaqueId: imageID})
|
||||||
imageItem.WebDavUrl = libregraph.PtrString(baseURL.String() + filepath.Join(space.Root.OpaqueId, *imagePath))
|
if err != nil {
|
||||||
spaceItems = append(spaceItems, *imageItem)
|
g.logger.Error().Err(err).Str("ID", imageID).Msg("Could not get image path")
|
||||||
|
} else {
|
||||||
|
imageItem.SpecialFolder = &libregraph.SpecialFolder{Name: libregraph.PtrString(SpaceImageSpecialFolderName)}
|
||||||
|
imageItem.WebDavUrl = libregraph.PtrString(baseURL.String() + filepath.Join(space.Root.OpaqueId, *imagePath))
|
||||||
|
spaceItems = append(spaceItems, *imageItem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,11 +289,10 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Use the Opaque prop of the space
|
// Use the Opaque prop of the space
|
||||||
opaque := make(map[string]*types.OpaqueEntry)
|
opaque := make(map[string]*types.OpaqueEntry)
|
||||||
spaceDescription := *drive.Description
|
if drive.Description != nil {
|
||||||
if spaceDescription != "" {
|
|
||||||
opaque["description"] = &types.OpaqueEntry{
|
opaque["description"] = &types.OpaqueEntry{
|
||||||
Decoder: "plain",
|
Decoder: "plain",
|
||||||
Value: []byte(spaceDescription),
|
Value: []byte(*drive.Description),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,6 @@ Feature: List and create spaces
|
|||||||
| name | Project Mars |
|
| name | Project Mars |
|
||||||
| quota@@@total | 1000000000 |
|
| quota@@@total | 1000000000 |
|
||||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||||
When user "Alice" lists all available spaces via the GraphApi
|
|
||||||
And user "Alice" lists the content of the space with the name "Project Mars" using the WebDav Api
|
|
||||||
Then the propfind result of the space should contain these entries:
|
|
||||||
| .space/ |
|
|
||||||
|
|
||||||
Scenario: An admin user can create a Space via the Graph API with certain quota
|
Scenario: An admin user can create a Space via the Graph API with certain quota
|
||||||
Given the administrator has given "Alice" the role "Admin" using the settings api
|
Given the administrator has given "Alice" the role "Admin" using the settings api
|
||||||
|
|||||||
Reference in New Issue
Block a user