Skip to content

Commit

Permalink
tests: add unit tests for public share provider
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Apr 24, 2024
1 parent 11431b3 commit dc8e143
Show file tree
Hide file tree
Showing 7 changed files with 1,346 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ packages:
github.com/cs3org/reva/v2/pkg/publicshare/manager/owncloudsql:
interfaces:
UserConverter:
github.com/cs3org/reva/v2/pkg/publicshare:
interfaces:
Manager:
github.com/cs3org/reva/v2/pkg/share:
interfaces:
Manager:
Expand Down
1 change: 1 addition & 0 deletions changelog/unreleased/fix-public-share-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Bugfix: Fix public share update

We fixed the permission check for updating public shares. When updating the permissions of a public share while not providing a password, the check must be against the new permissions to take into account that users can opt out only for view permissions.

https://github.com/cs3org/reva/pull/4633
https://github.com/cs3org/reva/pull/4622
6 changes: 6 additions & 0 deletions internal/grpc/services/publicshareprovider/expose_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package publicshareprovider

var (
ParseConfig = parseConfig
ParsePasswordPolicy = parsePasswordPolicy
)
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func NewDefault(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error
if err != nil {
return nil, err
}
return New(gatewaySelector, sm, c, p), nil
return New(gatewaySelector, sm, c, p)
}

// New creates a new user share provider svc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package publicshareprovider_test

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestPublicShareProvider(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "PublicShareProvider Suite")
}
Loading

0 comments on commit dc8e143

Please sign in to comment.