chore: move the go code into a subfolder

This commit is contained in:
Florian Forster
2025-08-05 15:20:32 -07:00
parent 4ad22ba456
commit cd2921de26
2978 changed files with 373 additions and 300 deletions

View File

@@ -0,0 +1,45 @@
package domain
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRoleOrgIDsFromScope(t *testing.T) {
type args struct {
scopes []string
}
tests := []struct {
name string
args args
want []string
}{
{
name: "nil",
args: args{nil},
want: nil,
},
{
name: "unrelated scope",
args: args{[]string{"foo", "bar"}},
want: nil,
},
{
name: "orgID role scope",
args: args{[]string{OrgRoleIDScope + "123"}},
want: []string{"123"},
},
{
name: "mixed scope",
args: args{[]string{"foo", OrgRoleIDScope + "123"}},
want: []string{"123"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := RoleOrgIDsFromScope(tt.args.scopes)
assert.Equal(t, tt.want, got)
})
}
}