mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
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:
@ -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()
|
||||
|
Reference in New Issue
Block a user