mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-01 04:50:16 +00:00
test: expand backend coverage
This commit is contained in:
parent
3ea5f54d93
commit
7f7edfceb4
118 changed files with 21980 additions and 74 deletions
17
internal/api/authorization_additional_test.go
Normal file
17
internal/api/authorization_additional_test.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package api
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestMultiTenantOrganizationLoader_NoPersistence(t *testing.T) {
|
||||
loader := NewMultiTenantOrganizationLoader(nil)
|
||||
if _, err := loader.GetOrganization("org"); err == nil {
|
||||
t.Fatalf("expected error when persistence is nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultAuthorizationChecker_CanAccessOrg_Default(t *testing.T) {
|
||||
checker := NewAuthorizationChecker(nil)
|
||||
if !checker.CanAccessOrg("user", nil, "default") {
|
||||
t.Fatalf("expected default org access")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue