// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. package model import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestIsValidPropertyOwnerType(t *testing.T) { for _, ownerType := range []string{ PropertyOwnerTypePlugin, PropertyOwnerTypeService, PropertyOwnerTypeRole, PropertyOwnerTypeUser, } { assert.True(t, IsValidPropertyOwnerType(ownerType), ownerType) } assert.False(t, IsValidPropertyOwnerType("")) assert.False(t, IsValidPropertyOwnerType("bogus")) } func TestIsValidPropertyOwnerScope(t *testing.T) { for _, scope := range []string{ "entra", "Okta", "entra:tenant-1", "a.b_c-d", "ldap", } { assert.True(t, IsValidPropertyOwnerScope(scope), scope) } for _, scope := range []string{ "", " spaces", "a b", "a\nb", "🔥", "