fix: add workspace_proxy type to auditlog friendly strings (#9194)

* fix: add workspace_proxy type to auditlog friendly strings
* add unit test and organization type
This commit is contained in:
Steven Masley
2023-08-21 10:53:41 -05:00
committed by GitHub
parent 07188b123a
commit b2ca3ebaa3
6 changed files with 38 additions and 4 deletions

View File

@ -5,10 +5,24 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/codersdk"
)
// TestAuditDBEnumsCovered ensures that all enums in the database are covered by the codersdk enums
// for audit log strings.
func TestAuditDBEnumsCovered(t *testing.T) {
t.Parallel()
dbTypes := database.AllResourceTypeValues()
for _, ty := range dbTypes {
str := codersdk.ResourceType(ty).FriendlyString()
require.NotEqualf(t, "unknown", str, "ResourceType %q not covered by codersdk.ResourceType", ty)
}
}
// TestViewSubsetTemplate ensures TemplateTable is a subset of Template
func TestViewSubsetTemplate(t *testing.T) {
t.Parallel()