mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
test: Increase test coverage on auditable resources (#7038)
* test: Increase test coverage on auditable resources When adding a new audit resource, we also need to add it to the function switch statements. This is a likely mistake, now a unit test will check this for you
This commit is contained in:
@ -884,6 +884,7 @@ const (
|
||||
ResourceTypeGroup ResourceType = "group"
|
||||
ResourceTypeWorkspaceBuild ResourceType = "workspace_build"
|
||||
ResourceTypeLicense ResourceType = "license"
|
||||
ResourceTypeWorkspaceProxy ResourceType = "workspace_proxy"
|
||||
)
|
||||
|
||||
func (e *ResourceType) Scan(src interface{}) error {
|
||||
@ -932,7 +933,8 @@ func (e ResourceType) Valid() bool {
|
||||
ResourceTypeApiKey,
|
||||
ResourceTypeGroup,
|
||||
ResourceTypeWorkspaceBuild,
|
||||
ResourceTypeLicense:
|
||||
ResourceTypeLicense,
|
||||
ResourceTypeWorkspaceProxy:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@ -950,6 +952,7 @@ func AllResourceTypeValues() []ResourceType {
|
||||
ResourceTypeGroup,
|
||||
ResourceTypeWorkspaceBuild,
|
||||
ResourceTypeLicense,
|
||||
ResourceTypeWorkspaceProxy,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user